
On Sat, 21 Apr 2012, Russell Coker wrote:
On Sat, 21 Apr 2012, Tim Connors <tconnors@rather.puzzling.org> wrote:
Not taking rename() as being an implicit barrier is braindead. ext4 fixed that. I don't believe XFS has for idealogical reasons. Instead of putting a small workaround that causes bugger-all impact on performance in kernel code, they insist that decades of userspace should change its behaviour instead.
Is relying on rename() as a barrier without using fsync(), fdatasync(), or sync() something that many applications do?
Um. Yes. http://mail.opensolaris.org/pipermail/zfs-discuss/2009-March/027379.html Believing that, somehow, "metadata" is more important than "other data" should have been put to rest with UFS. Yes, it's easier to "fsck" the filesystem when the metadata is correct and that gets you a valid filesystem but that doesn't mean that you get a filesystem with valid contents. ... As long as POSIX believes that systems don't crash, then clearly there is nothing in the standard which would help the argument on either side. It is a "quality of implementation" property. Apparently, T'so feels that reordering filesystem operations is fine. http://mail.opensolaris.org/pipermail/zfs-discuss/2009-March/027389.html Pragmatically, it is much easier to change the file system once, than to test or change the zillions of applications that might be broken. Fortunately, the transaction groups in zfs seem to take care of write ordering: "AFAIUI, the ZFS transaction group maintains write ordering, at least as far as write()s to the file would be in the ZIL ahead of the rename() metadata updates." I haven't read the rest of the thread yet, but that thread makes for interesting reading. I trust solaris guys when it comes to application and operating system reliability more than I trust some linux people.
The case of writing to a new file and then renaming it over the old one isn't such a common application usage pattern.
Um. OK.
It's used for updates to /etc/shadow etc (I'm sure those programs are solid), by rsync (Tridge is a great coder),
rsync uses fsync? You might want to run your strace again, because I've got news for you. I'm glad it doesn't, because that sure as hell would have slowed down the sync I did of my photos yesterday after running gpscorrelate. -- Tim Connors