]> www.infradead.org Git - users/hch/xfstests-dev.git/commit
generic/331,xfs/240: support files that skip delayed allocation
authorDarrick J. Wong <djwong@kernel.org>
Thu, 21 Nov 2024 00:27:33 +0000 (16:27 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 23 Jan 2025 21:19:58 +0000 (13:19 -0800)
commit255dba0d9b9d241da370ef9a0ea4c2f92d009f3e
tree5c3ea4f0ce31bbb6ccae5b7746c85cf8e9a2bc35
parent68ec5e4f8b0f526a767afe7c6f1716c1f4b9740e
generic/331,xfs/240: support files that skip delayed allocation

The goal of this test is to ensure that log recovery finishes a copy on
write operation in the event of temporary media errors.  It's important
that the test observe some sort of IO error once we switch the scratch
device to fail all IOs, but regrettably the test encoded the specific
behavior of XFS and btrfs when the test was written -- the aio write
to the page cache doesn't have to touch the disk and succeeds, and the
fdatasync flushes things to disk and hits the IO error.

However, this is not how things work on the XFS realtime device.  There
is no delalloc on realtime when the rt extent size > 1 fsblock (or on
any file with extent size hints), so the aio write allocates an
unwritten extent to stage the write.  The allocation fails due to EIO,
so it's the write call that fails.  Therefore, all we need to do is to
detect an IO error at any point between the write and the fdatasync call
to be satisfied that the test does what we want to do.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
tests/generic/331
tests/generic/331.out
tests/xfs/240
tests/xfs/240.out