On November 3, Mikulas Patocka wrote:
> BTW. Why does it sometimes overwrite files with zeros after crash and
> journal replay then? I thought that this was because it tries to avoid
> users seeing uninitialized data.
It doesn't overwrite the file with zeros. You're getting an inode
that has a non-zero size, but no data in the file. That is, a file
that is a single hole. This happens because XFS logs metadata
quickly, but the data in the file gets written more slowly.
You'll see the same zeroing if you create a sparse file: write a
megabyte of data, lseek forward a megabyte, and write another megabyte
of data. When reading the area you lseeked over, it will read as
zeros.
The same is done for files that were preallocated, but haven't been
written to (that is, the file has unwritten extents).
You can look at the files in question with xfs_bmap -v and see that
there's no extents there.
Glen Overby
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]