Re: [VFS?] flush-on-close() & close(2) guarantees ?

From: tytso@mit.edu
Date: Fri Mar 17 2000 - 02:45:38 EST


   Date: Thu, 16 Mar 2000 00:24:41 +0100 (CET)
   From: "Cyrille Chepelov (home)" <chepelov@calixo.net>

   Does close(2) actually guarantees, on ext2fs, that all data is flushed to
   disk ? filp_close() does indeed try to call f_op->flush() if it exists,
   but unfortunately, only CODA and NFS seem to provide such a flush()
   function.

No, it doesn't. It's not the case for nearly all filesystems (with
networked filesystems being the notable execption) and for all operating
systes, including Windblows and other Unix systems.

   Does ext2, in async mode, do anything to guarantee that if all write()s to
   a file succeed and the subsequent close() succeeds, then the power
   suddenly goes off, the file is still correctly written to the disk ? (I
   think about behaviour things like MTAs might require)

Nope. If you care about this, call fsync() before call close().
That's what MTA's do.

                                                - Ted

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Mar 23 2000 - 21:00:22 EST