From 9bc323f334b64a7ad6888de9816b88fb0f4f78ea Mon Sep 17 00:00:00 2001 From: Sun Ke Date: Fri, 28 May 2021 05:40:46 -0400 Subject: [PATCH] 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 Reviewed-by: Darrick J. Wong Signed-off-by: Eryu Guan --- tests/xfs/070 | 3 ++- tests/xfs/448 | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/xfs/070 b/tests/xfs/070 index 8249c5c0..9ef1e786 100755 --- a/tests/xfs/070 +++ b/tests/xfs/070 @@ -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 diff --git a/tests/xfs/448 b/tests/xfs/448 index 493d303e..a11698fa 100755 --- a/tests/xfs/448 +++ b/tests/xfs/448 @@ -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 -- 2.30.2