Re: [PATCH] zerocopy NFS updated

Andreas Dilger
2002-04-25T17:13:37Z

On Apr 24, 2002 16:11 -0700, Mike Fedyk wrote:
> Actually, with ext3 the only mode IIRC is data=journal that will keep this
> from happening. In ordered or writeback mode there is a window where the
> pages will be zeroed in memory, but not on disk.
>
> Admittedly, the time window is largest in writeback mode, smaller in ordered
> and smallest (non-existant?) in data journaling mode.

One thing you are forgetting is that with data=ordered mode, the inode
itself is not updated until the data has been written to the disk. So
technically you are correct - with ordered mode there is a window where
pages are updated in memory but not on disk, but if you crash during
that window the inode size will be the old size so you will still not be
able to access the un-zero'd data on disk.

It is only with data=writeback that this could be a problem, because
there is no ordering between updating the inode and writing the data
to disk. That's why there is only a real benefit to using
data=writeback for applications like databases and such where the file
size doesn't change and you are writing into the middle of the file.
In many cases, data=ordered is actually faster than data=writeback.

Cheers, Andreas
--
Andreas Dilger