O_PONIES
O_PONIES
Posted Jul 2, 2009 23:36 UTC (Thu) by mikov (guest, #33179)In reply to: O_PONIES by mjg59
Parent article: In brief
Adding transaction semantics to the file system in this one case is the road to madness. Fortunately I think that it has very little chance of being accepted in the kernel.
(Also, you can see my other response to spitzak below).
Posted Jul 2, 2009 23:40 UTC (Thu)
by mjg59 (subscriber, #23239)
[Link] (3 responses)
Posted Jul 2, 2009 23:57 UTC (Thu)
by mikov (guest, #33179)
[Link] (1 responses)
Instead I would suggest one of:
- Put all the error prone logic (the temporary file, fsync(), permission and attribute copying, etc) in a portable library routine relying only on POSIX and simply live with the fsync() overhead on ext3.
or
- Again put it in a portable library routine, but without the fsync(). The rename problem has already been addressed in ext4, so it is safe, and in ext3 there is a global sync frequently enough that it isn't a problem in practice (explaining why nobody ever complained about it before ext4).
Posted Jul 3, 2009 0:19 UTC (Fri)
by mjg59 (subscriber, #23239)
[Link]
Posted Jul 3, 2009 16:55 UTC (Fri)
by quotemstr (subscriber, #45331)
[Link]
O_PONIES
O_PONIES
O_PONIES
I'm firmly in the O_PONIES
fsync
-is-horrible-renames-should-be-write-barriers camp, but if you want to expose a way to for an application to tell whether it should fsync
or not, the best way is to use the existing pathconf
mechanism. Using that, an application can just ask the kernel, "Do I need to fsync this particular file?". It's much more elegant than trying to have applications puzzle it out from filesystem-type information.