Re: How to flush data to disk reliably?

From: Arjan van de Ven
Date: Mon May 02 2005 - 18:20:36 EST


On Mon, 2005-05-02 at 18:30 -0400, Bill Davidsen wrote:
> On Mon, 2 May 2005, Alan Cox wrote:
>
> > On Llu, 2005-05-02 at 20:18, Grzegorz Kulewski wrote:
> > > What about other filesystems? Does anybody know anwser for Reiserfs3,
> > > Reiser4, JFS, XFS and any other popular server filesystems? I assume that
> > > if log file is some block device (like partition) both O_SYNC and fsync
> > > will work? What about ext2? What about some strange RAID/DM/NBD
> > > configurations? (I do not know in advance what our customers will use so I
> > > need portable method.)
> >
> > RAID does stripe sized rewrites so you get into the same situation as
> > with actual disks - a physical media failure might lose you old data
> > (but then if the disk goes bang so does the data...)
>
> I hope I'm reading that wrong, and that rewriting a single sector of a
> file doesn't result in r-a-w of the entire stripe. That would be a large
> memory hit for filesystems with large stripes for mostly sequential i/o.

it results in a read of the entire stripe and at least two writes (the
actual data and the new parity)

the alternative (and I don't think linux does that) is to read the old
data sector, and do an differential xor.



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