]> www.infradead.org Git - users/hch/xfstests-dev.git/commit
fstests: generic/563: use fs blocksize to do the writes
authorQu Wenruo <wqu@suse.com>
Sun, 29 Sep 2024 23:50:38 +0000 (09:20 +0930)
committerZorro Lang <zlang@kernel.org>
Thu, 10 Oct 2024 06:46:21 +0000 (14:46 +0800)
commit034e5655933729ef334b6355c94607d115414282
tree37b1328f9f19ae9d7e6f4466e1cd2f76ed36128f
parente0c84186bfdaa7c48f144d60ff1c8d03a416b113
fstests: generic/563: use fs blocksize to do the writes

[FALSE ALERTS]
If the system has a page size larger than 4K, and the fs block size
matches the page size, test case generic/563 will fail:

    --- tests/generic/563.out 2024-04-25 18:13:45.178550333 +0930
    +++ /home/adam/xfstests-dev/results//generic/563.out.bad 2024-09-30 09:09:16.155312379 +0930
    @@ -3,7 +3,8 @@
     read is in range
     write is in range
     write -> read/write
    -read is in range
    +read has value of 8388608
    +read is NOT in range -33792 .. 33792
     write is in range
    ...

Both Ext4 and btrfs fail with 64K block size and 64K page size

[CAUSE]
The test case writes the 8MiB file using the default block size xfs_io
pwrite, which is 4KiB.

Since the fs block size is 64K, such 4KiB write is unaligned inside a
block, causing the fs to read out the full page.

Thus the pwrite will cause the fs to read out every page, resulting the
above 8MiB+ read value.

[FIX]
Fix the test case by using the fs block size to avoid such unaligned
buffered write.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Boris Burkov <boris@bur.io>
Reviewed-by: Mark Harmstone <maharmstone@fb.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/563