lkml.org 
[lkml]   [2000]   [Mar]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [VFS?] flush-on-close() & close(2) guarantees ?
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/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.044 / U:1.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site