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

From: Jamie Lokier (lk@tantalophile.demon.co.uk)
Date: Thu Mar 16 2000 - 13:08:56 EST


Cyrille Chepelov (home) wrote:
> Does close(2) actually guarantees, on ext2fs, that all data is flushed to
> disk ?

No.

> 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.

That's for cache coherency between different machines. On NFS, it is
usual to expect that if you call close() on one machine and then open()
on another, the other machine will see the written data.

> 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)

MTAs call sys_fsync().

-- Jamie

>
> If not, wouldn't it be good to provide something like
> void generic_flush(file *filp) {
> if (filp->f_op)
> filp->f_op->fsync(filp,filp->f_dentry);
> }
> and tell all filesystems without a specific f_op->flush() to use that ?
>
>
> Just wondering...
>
> -- Cyrille
>
> ------------------------------------------------------------------------------
> Grumpf.
>
>
>
> -
> 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/

-
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:19 EST