diff options
author | Darrick J. Wong <djwong@kernel.org> | 2023-06-06 15:29:14 -0700 |
---|---|---|
committer | Zorro Lang <zlang@kernel.org> | 2023-06-10 15:35:59 +0800 |
commit | 27d202f5c8de0622a11a762a64731c6f45531993 (patch) | |
tree | 32d54d632e1c1f461938aa2407708d770ccfe923 | |
parent | 156a8a1078509f5cc4bf528bf7246208641ee67e (diff) | |
download | xfstests-dev-27d202f5c8de0622a11a762a64731c6f45531993.tar.gz |
xfs/155: discard stderr when checking for NEEDSREPAIR
This test deliberate crashes xfs_repair midway through writing metadata
to check that NEEDSREPAIR is always triggered by filesystem writes.
However, the subsequent scan for the NEEDSREPAIR feature bit prints
verifier errors to stderr.
On a filesystem with metadata directories, this leads to the test
failing with this recorded in the golden output:
+Metadata CRC error detected at 0x55c0a2dd0d38, xfs_dir3_block block 0xc0/0x1000
+dir block owner 0x82 doesnt match block 0xbb8cd37e44eb3623
This isn't specific to metadata directories -- any repair crash could
leave a metadata structure in a weird state such that starting xfs_db
will spray verifier errors. For _check_scratch_xfs_features here, we
don't care if the filesystem is corrupt; we /only/ care that the
superblock feature bit is set. Route all that noise to devnull.
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Andrey Albershteyn <aalbersh@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
-rwxr-xr-x | tests/xfs/155 | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/xfs/155 b/tests/xfs/155 index c4ee8e20ef..25cc84069c 100755 --- a/tests/xfs/155 +++ b/tests/xfs/155 @@ -55,7 +55,7 @@ for ((nr_writes = 1; nr_writes < max_writes; nr_writes += nr_incr)); do # but repair -n says the fs is clean, then it's possible that the # injected error caused it to abort immediately after the write that # cleared NEEDSREPAIR. - if ! _check_scratch_xfs_features NEEDSREPAIR > /dev/null && + if ! _check_scratch_xfs_features NEEDSREPAIR &> /dev/null && ! _scratch_xfs_repair -n &>> $seqres.full; then echo "NEEDSREPAIR should be set on corrupt fs" fi @@ -63,7 +63,7 @@ done # If NEEDSREPAIR is still set on the filesystem, ensure that a full run # cleans everything up. -if _check_scratch_xfs_features NEEDSREPAIR > /dev/null; then +if _check_scratch_xfs_features NEEDSREPAIR &> /dev/null; then echo "Clearing NEEDSREPAIR" >> $seqres.full _scratch_xfs_repair 2>> $seqres.full _check_scratch_xfs_features NEEDSREPAIR > /dev/null && \ |