Subject: Re: SOFTDEPS safe for qmail?
To: Don Lewis <Don.Lewis@tsc.tdk.com>
From: Greg Hudson <ghudson@MIT.EDU>
List: current-users
Date: 06/17/2000 10:14:55
>>> If you add the second fsync to force the rename out to disk, you
>>> should be all set..

>> Is that really guaranteed?

> It is guaranteed by softdep.  When you fsync() a file whose
> directory entry has not been pushed to disk, the softdep code writes
> the directory entry before fsync() returns.

Ah, someone who appears to know what they are talking about.  I have a
few long-standing questions about FFS and softdep:

Suppose I open a new file, write to it, fsync it, and close it.  As
you just said, with or without softdep, after the fsync() returns I
can be sure that even if the machine reboots uncleanly RIGHT NOW the
file exists on disk.  Now, suppose I rename() the file:

	* Without softdep, after the rename() returns, can I assume
	  that if the machine reboots uncleanly RIGHT NOW, the file
	  will exist with the new name?  Does the answer change with
	  softdep?

	* With softdep, if after the rename() I open the file,
	  fsync() it, and close() the file, can I be assured that the
	  rename has been committed?

	* With Linux ext2fs, I can open the directory, fsync() it, and
	  close the directory, and be certain that the rename is
	  committed.  (Although I'll trigger a bug in older versions
	  of the kernel and kill my performance, but let's ignore
	  that.)  Does that work in FFS, with or without softdeps?

Thanks very much for your time.