[PATCH] common/filestreams: check zoned device before mkfs with small dsize
Shin'ichiro Kawasaki <[email protected]>
| Newsgroups | org.kernel.vger.fstests,org.kernel.vger.linux-xfs |
|---|---|
| Message-ID | <[email protected]> |
The test case xfs/170 performs file stream tests and must be skipped for zoned scratch devices since the filestream feature is not supported. The test calls _require_xfs_scratch_non_zoned() to check if the scratch device is zoned. This check is done after _try_scratch_mkfs_xfs() with a small dsize parameter. However, mkfs.xfs creates an inode for each zone, and when a zoned device has many zones, the small dsize causes metadata area shortage and mkfs fails. This unexpected failure causes the test to fail even though it should be skipped for zoned devices. Move the zoned device check to occur before the constrained mkfs. First perform a usual mkfs without the small dsize parameter to ensure the device can be properly checked for zoned mode, then verify it's non- zoned before proceeding with the small dsize mkfs. Signed-off-by: Shin'ichiro Kawasaki <[email protected]> --- common/filestreams | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/common/filestreams b/common/filestreams index ace8f3b7..838b5921 100644 --- a/common/filestreams +++ b/common/filestreams @@ -86,6 +86,14 @@ _test_streams() { # off the filestreams allocator. unset SCRATCH_RTDEV + # Skip these tests on zoned file systems as filestreams don't work + # with the zoned allocator, and the operation below would force it into + # the tiny data section only used for metadata anyway. + _try_scratch_mkfs_xfs >/dev/null 2>&1 || _fail "mkfs failed" + _scratch_mount + _require_xfs_scratch_non_zoned + _scratch_unmount 2>/dev/null + local size=`expr $agsize \* 1024 \* 1024 \* $agcount` _try_scratch_mkfs_xfs -dsize=$size,agcount=$agcount >/dev/null 2>&1 \ || _fail "mkfs failed" @@ -99,11 +107,6 @@ _test_streams() { _scratch_mount fi - # Skip these tests on zoned file systems as filestreams don't work - # with the zoned allocator, and the above would force it into the - # tiny data section only used for metadata anyway. - _require_xfs_scratch_non_zoned - cd $SCRATCH_MNT # start $stream_count streams -- 2.54.0