]> www.infradead.org Git - users/hch/xfstests-dev.git/commit
generic/392: stop checking st_blocks
authorChristoph Hellwig <hch@lst.de>
Mon, 26 Feb 2024 10:03:19 +0000 (11:03 +0100)
committerZorro Lang <zlang@kernel.org>
Tue, 12 Mar 2024 03:39:52 +0000 (11:39 +0800)
commit7bb78927c0f53f7b86f932836ef1d3b34606a3a9
tree84c89b4ca4955e223e4cf7c34c9df6e02257f38b
parentb3ff58fa319a103e54bdc70b78fa225ac5683945
generic/392: stop checking st_blocks

st_blocks is a rather vaguely defined field.  To quote the Linux stat(2)
man page:

    Use of the st_blocks and st_blksize fields may be less portable.
    (They were introduced in BSD.  The interpretation differs between
    systems, and possibly on a single system when NFS mounts are
    involved.)

or the FreeBSD one:

    st_blocks   Actual number of blocks allocated for the file in
512-byte units.  As short symbolic links are stored in
the inode, this number may be zero.

and at least for XFS they include speculative preallocations and
in-flight COW fork allocations, and the numbers can change when the way
how data is stored is reorganized.  Because of that it doesn't make sense
to require st_blocks to not change after a crash even when fsync or
fdatasync was involved.

Remove the st_blocks checks and the now superfluous XFS always_cow
workaround.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/392