Ted speaks again
Posted Mar 16, 2009 12:29 UTC (Mon) by
forthy (guest, #1525)
In reply to:
Ted speaks again by regala
Parent article:
Garrett: ext4, application expectations and power management
Maybe some people didn't read the POSIX standard. But this doesn't
actually matter, because Ted Ts'o didn't read it either. He's just
ducking behind it, because POSIX makes no promise in case of a system
crash. That's anal-retentive, because POSIX makes promises about ordering
(ordering is strong), and a supposed-to-be-reliable file system
should keep that order even after a crash. If ext4 doesn't (ext3 in
data=ordered mode does, btrfs should do according to the FAQ, and will
actually do - bugs happen - in 2.6.30, too, etc.), then the users will
just not use ext4.
In the long thread of the previous discussion about this topic, the
semantics behind the different operations were clearly described.
POSIX promises atomicy of operations like rename(). Should this atomicy
be preserved in case of a crash? Sane file system design says: yes.
People who use create-write-close-rename want atomicy, if they
also want durability (i.e. know that the new file is actually
committed), they need fsync, too. To be precise: fsync on the file
and on the directory. Atomic operations are part of the POSIX file
system semantics, durability is part of fsync's semantics.
When do you need durability? E.g. in a networked ordering system - if
you receive an order over network, you update your books, make the first
half of the booking durable, confirm the order, and when you know that
the confirmation is out, then you finalize your booking and make that
durable, as well (double handshake). You don't need durability if you
just update your configuration settings, but you need atomicy to avoid
loss of all configuration settings.
Note that POSIX still does not
guarantee anything in case of a crash - complete loss of data and
metadata is "allowed". Whether I or anyone else actually wants to
use such a file system is a completely different question.
(
Log in to post comments)