[Mimedefang] BIG problems with mimedefang

Les Mikesell les at futuresource.com
Thu Jan 19 14:07:26 EST 2006


On Thu, 2006-01-19 at 12:30, WBrown at e1b.org wrote:
> mimedefang-bounces at lists.roaringpenguin.com wrote on 01/19/2006 12:30:47 
> PM:
> 
> > 3) Atomically rename database.db.new to database.db
> 
> Can you enlightne me on what "Atomically rename" means?  How is that 
> different than just a mv command.  I can understand that a process that 
> opened the file under the old name is still going to point to the file 
> based on its location on disk, not by name.  I'm just picturing mushroom 
> clouds and guys in lead hazmat suits trying to do an atomic rename. :)

The non-atomic version boils down to 
  unlink(newname)  - if newname filename already exists
  link(oldname, newname) - now both exist
  unlink(oldname)
Other processes may get timeslices that see the filesystem
in any of those states, including the one where the newname
doesn't exist at all.  I think mv will attempt a rename
and only do it the hard way if the rename fails, which should
only happen if the old/new files are on different filesystems
in which case the hard way involves a copy.

-- 
  Les Mikesell
   les at futuresource.com





More information about the MIMEDefang mailing list