xfs: fix check of whether the mkfs fail

The return value ("$?") is always the status of the last command in
the pipe.

Signed-off-by: Sun Ke <sunke32@huawei.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
This commit is contained in:
Sun Ke
2021-05-28 05:40:46 -04:00
committed by Eryu Guan
parent f360daadb2
commit 9bc323f334
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -84,7 +84,8 @@ _supported_fs xfs
_require_scratch_nocheck
_require_command "$KILLALL_PROG" killall
_scratch_mkfs | _filter_mkfs > /dev/null 2> $tmp.mkfs || _fail "mkfs failed"
_scratch_mkfs | _filter_mkfs > /dev/null 2> $tmp.mkfs
test "${PIPESTATUS[0]}" -eq 0 || _fail "mkfs failed"
. $tmp.mkfs # import agcount
+2 -1
View File
@@ -47,7 +47,8 @@ _require_no_xfs_bug_on_assert
rm -f "$seqres.full"
# Format and mount
_scratch_mkfs | _filter_mkfs > $seqres.full 2> $tmp.mkfs || _fail "mkfs failed"
_scratch_mkfs | _filter_mkfs > $seqres.full 2> $tmp.mkfs
test "${PIPESTATUS[0]}" -eq 0 || _fail "mkfs failed"
_scratch_mount
# Get directory block size