On Sun, Nov 18, 2001 at 09:03:54AM +0100, Christian Zander wrote:
>
> Hey all,
>
> I have been using xfs for quite a while now and I have been mostly
> happy with it for its performance and utilities. There is one issue,
> however, that I have run into a couple of times and that I consider
> grave and makes me consider switching back to another journaling
> filesystem.
>
> I've had problems with severe file corruption; i.e. several times,
> files had been opened at the time of a system hang were overwritten
> with zeros and hence completely trashed. Affected files were files
> opened in editors and configuration files such as XF86Config. This
> has been happening randomly but also fairly regularly and doesn't
> seem to be specific to certain hard- or software setups. The last
> occurance happened with 2.4.14. I'm building xfs with gcc-2.91.66
> as recommended.
>
> Any suggestions are welcome. Please cc: any response to my email
> address as I am not subscribed to the list.
You're really asking a FAQ. Please check the FAQ.
In short what you're seeing is that the files have their metadata (file size)
but not their data flushed yet. The file has turned into an hole. One of the
reasons
XFS is so fast is that it delays data flushing until it has enough data to
allocate
a big chunk on disk. Because of that it can happen that the data has not made it
to disk yet, but the file size has, turning the file into a hole (= zeroes).
The journaling file system does only protect the metadata, not the data.
Possibilities are to type sync manually, change your editor to use
fsync/O_SYNC/O_DSYNC
to force data to disk or mount the filesystem with one of the
slower-but-somewhat
safer sync/dsync etc. options.
The other file systems have the same problem BTW, although it is less often seen
in practice because they don't delay writes as aggressively as XFS.
-Andi
|