]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
xfs/015: check _scratch_mkfs_sized return code
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Fri, 18 Feb 2022 07:31:55 +0000 (16:31 +0900)
committerEryu Guan <guaneryu@gmail.com>
Sun, 20 Feb 2022 17:01:19 +0000 (01:01 +0800)
The test cases xfs/015 calls _scratch_mkfs before _scratch_mkfs_sized,
and does not check return code of _scratch_mkfs_sized. Even if
_scratch_mkfs_sized failed, _scratch_mount after it cannot detect the
sized mkfs failure because _scratch_mkfs already created a file system
on the device. This results in unexpected test condition.

To avoid the unexpected test condition, check return code of
_scratch_mkfs_sized.

Suggested-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/xfs/015

index 86fa63367a0f59ed8fc937ad96fc2a9c11abd5d4..2bb7b8d5097565cc052814eb3b195cc042913aad 100755 (executable)
@@ -43,7 +43,7 @@ _scratch_mount
 _require_fs_space $SCRATCH_MNT 131072
 _scratch_unmount
 
-_scratch_mkfs_sized $((32 * 1024 * 1024)) > $tmp.mkfs.raw
+_scratch_mkfs_sized $((32 * 1024 * 1024)) > $tmp.mkfs.raw || _fail "mkfs failed"
 cat $tmp.mkfs.raw | _filter_mkfs >$seqres.full 2>$tmp.mkfs
 # get original data blocks number and agcount
 . $tmp.mkfs