]> www.infradead.org Git - users/hch/xfstests-dev.git/commit
common/rc: Modify _require_batched_discard to improve test coverage
authorOjaswin Mujoo <ojaswin@linux.ibm.com>
Mon, 16 May 2022 08:45:05 +0000 (14:15 +0530)
committerZorro Lang <zlang@kernel.org>
Mon, 16 May 2022 14:38:26 +0000 (22:38 +0800)
commitee264b3fa67646e4724685be3250e8a24f30f36a
tree591a39277d1ab0d85fb5784ff95ef43398d15c8c
parent781bb995a149e0dae074019e56477855587198cf
common/rc: Modify _require_batched_discard to improve test coverage

A recent ext4 patch discussed [1] that some devices (eg LVMs) can
have a discard granularity as big as 42MB which makes it larger
than the group size of ext4 FS with 1k BS.  This causes the FITRIM
IOCTL to fail.

This case was not correctly handled by this test since
"_require_batched_discard" incorrectly interpreted the FITRIM
failure as SCRATCH_DEV not supporting the IOCTL. This caused the test
to report "not run" instead of "failed" in case of large discard granularity.

Fix "_require_batched_discard" to use a more accurate method
to determine if discard is supported.

[1] commit 173b6e383d2
    ext4: avoid trim error on fs with small groups

Signed-off-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Reviewed-by: Ritesh Harjani <riteshh@linux.ibm.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
common/rc