Subject: Re: SOFTDEPS safe for qmail?
To: Todd Vierling <tv@pobox.com>
From: Don Lewis <Don.Lewis@tsc.tdk.com>
List: current-users
Date: 06/16/2000 00:45:44
On Jun 15,  8:17pm, Todd Vierling wrote:
} Subject: Re: SOFTDEPS safe for qmail?
} On Thu, 15 Jun 2000, Peter Seebach wrote:
} 
} : "safe", yes, but there's no promise that a given write will have actually
} : taken place physically in the event of a crash, only that the set of writes
} : which has happened is expected to be consistent.  qmail may be depending on
} : certain operations being really-synchronous.
} 
} Hrmpf.
} 
} I wonder, hypothetically[!], whether the softdep code could be made to honor
} fsync(2).

It already does.  When you fsync() a file, the softdep code even pushes
the file's directory entry to disk before it returns.

The only problem I can think of for something like qmail is if it does
something like:
	write message to file
	fsync file
	rename file (to indicate that the file is a complete message)
	tell sender that the message has been received

This depends on rename() being synchronous and that's not the
case with softdep.  If the machine crashes after the sender has been
notified but before the directory change has been pushed to disk there
will be a complete copy of the message on disk, but stored under the
"wrong" name.

I haven't looked at the qmail code, so I don't know if this would
be a problem.