LWN.net Logo

XFS: the filesystem of the future?

XFS: the filesystem of the future?

Posted Mar 6, 2012 22:05 UTC (Tue) by nybble41 (subscriber, #55106)
In reply to: XFS: the filesystem of the future? by dgc
Parent article: XFS: the filesystem of the future?

> open(tmpfile)
> write(tmpfile)
> fsync(tmpfile)
> rename(tmpfile, destination)

Now find a way to do that *without* the need for a temporary file, and you might have something relevant to contribute to the thread.

A temporary file is not always an acceptable option; it presumes that you know of a directory in which you can create a temporary file guaranteed to be on the same filesystem as the file that it's replacing, so that rename() can be implemented atomically, and that either there are no hard links to the file or that those links should be broken by the rename(). Moreover, the rename() method resets portions of the security context of the original file, including ownership and security labels, which you can't restore without superuser capabilities.

This thread exists because people who do know plenty about the POSIX interfaces also know that they don't provide a general solution.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds