Re: XFS: how to NOT null files on fsck?

From: Chris Wedgwood
Date: Mon Jul 12 2004 - 18:15:47 EST


On Tue, Jul 13, 2004 at 01:03:04AM +0200, Bernd Eckenfels wrote:

> open("test.txt", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 3

old data blocks release (truncated), transaction for this written to
journal more-or-less synchronously

> write(3, "test\ntest\n", 10) = 10
> close(3) = 0

new data sitting in page-cache, not written to disk (in the case of
XFS the new blocks probably aren't even allocted at this stage). the
file size being extended is i assume recorded in the journal though.

if you crash now, you see nulls or a truncated file, i think this is
what people are getting with dotfiles

KDE is especially good at triggering this it seems


--cw
-
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/