Re: intermediate summary of ext3-2.4-0.9.4 thread

Matthias Andree (matthias.andree@stud.uni-dortmund.de)
Fri, 3 Aug 2001 02:14:06 +0200


On Fri, 03 Aug 2001, Anton Altaparmakov wrote:

> Unfortunately, your argument contains a fallacy which I believe is due to
> you not understanding the fact that file names are stored in their parent
> directories and _not_ in the files themselves, thus if you do a fsync() on
> a filedescriptor and you would like the name belonging to this
> filedescriptor to be synced to disk, the ONLY possible way to do this it to
> sync the parent directory in order to commit the file name to disk. On some

Do I really need to sync the WHOLE parent directory? Not just the
relevant part? My directories hardly have only 1 disk block.

> To summarize: basically you want the directory to be synced inside the
> fsync() of the filedescriptor (with the advantage of being able to optimize
> the directory sync to be a partial directory sync), while others want you

Yes, that's the point.

> to explicitly sync the directory filedescriptor afterwards.

Which is non-portable and will not be done by many application
programmers which just use chattr +S instead (makes things S)afe and
S)low) - and spoil performance that way since it makes not only
directory writes synchronous, but file (data) writes as well.

> That is impossible, see my above explanation, but to emphasize again: if
> you write out the file name of one file in a directory you have to write
> all of them (unless you can optimize but even then you will be writing more
> than one file name), including your temporary files, which you would like
> not to be synced to disk. Remember you have to write out whole blocks at

If they're synched because they're in the same block(s), that's fine and
is no harm because these blocks would've been written anyways.

The actual problem is the application programmer's unwillingness to
adopt the Linux peculiarities of the file system -- chattr +S is slower
than a dirsync mount option would be (and if it initially doesn't
optimize directory syncs, that's fine, because chattr +S is still worse,
and if we can get rid of chattr +S in the first place, without hacking
up all applications that came from BSD, that's fine).
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/