fstests: check file block congruency of file range operations

I started running fstests with XFS filesystems that don't have the usual
file geometry characteristics -- block sizes larger than 4k, realtime
filesystems with extent sizes that aren't a power of two, etc.  What I
found is that many file operation tests (fallocate, reflink, etc.) that
operate on disk blocks assume that aligning the arguments to 64k is
sufficient to avoid EINVAL.  Unfortunately, this just means that these
tests fail left and right on realtime filesystems where the file
allocation unit is large (~2MB, anyone?) or a weird number (28K).

Add a predicate to all of these tests so that we can _notrun them if
they make assumptions about file size /and/ encode something (usually
file hashes) in the golden output that mean we can't easily accomodate
these corner cases without redesigning each test.
punch: skip fpunch tests when page size not congruent with file allocation unit

Skip the generic fpunch tests on a file when the file's allocation unit
size is not congruent with the system page size.  This is needed for
testing swapfiles and mmap collisions wiht fallocate.

Assuming this edgecase configuration of an edgecase feature is
vanishingly rare, let's just _notrun the tests instead of rewriting a
ton of tests to do their integrity checking by hand.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
2 files changed