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>