Skip to content

Commit 2e01e0c

Browse files
committed
btrfs-progs: fsck-tests: make the warning check more specific for 057
[BUG] On older kernels without the fix ae4477f93756 ("btrfs: update superblock's device bytes_used when dropping chunk"), the test case 057 will result super block device item to mismatch with the chunk one. Normally this is not a big deal, but newer btrfs-progs will check for such mismatch. Although newer btrfs-progs won't report this as an error, the test case fsck/057 will manually check for any warnings, and fail the test case: ====== RUN CHECK /home/runner/work/btrfs-progs/btrfs-progs/btrfs check /dev/loop1 [1/8] checking log skipped (none written) [2/8] checking root items [3/8] checking extents WARNING: device 2's bytes_used was 503316480 in tree but 570425344 in superblock [4/8] checking free space tree [5/8] checking fs roots [6/8] checking only csums items (without verifying data) [7/8] checking root refs [8/8] checking quota groups skipped (not enabled on this FS) Opening filesystem to check... Checking filesystem on /dev/loop1 UUID: efd3e3b9-2fac-4a6f-b378-34694dc2d446 found 147456 bytes used, no error found total csum bytes: 0 total tree bytes: 147456 total fs tree bytes: 32768 total extent tree bytes: 16384 btree space waste bytes: 139992 file data blocks allocated: 0 referenced 0 That WARNING line will fail the test case, even if we didn't error out. [CAUSE] The test case itself is a test case for btrfs-progs commit 0dc8b8b ("btrfs-progs: check: fix wrong total bytes check for seed device"), which will report minor warning like the following: [2/7] checking extents WARNING: minor unaligned/mismatch device size detected WARNING: recommended to use 'btrfs rescue fix-device-size' to fix it But in this particular case, 057 should only check for the related wanrings, not something caused by the kernel. [FIX] Make the warning check in fsck/057 more specific, instead of "WARNING" use "fix-device-size" as the keyword. This is an unfortunate workaround for the CI kernels, which doesn't have fast enough backport of upstream kernel fixes. Reviewed-by: Boris Burkov <[email protected]> Signed-off-by: Qu Wenruo <[email protected]>
1 parent 3482192 commit 2e01e0c

File tree

1 file changed

+3
-3
lines changed
  • tests/fsck-tests/057-seed-false-alerts

1 file changed

+3
-3
lines changed

tests/fsck-tests/057-seed-false-alerts/test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ sprouted_output=$(_mktemp btrfs-progs-sprouted-check-stdout.XXXXXX)
3535
run_check_stdout $SUDO_HELPER "$TOP/btrfs" check "$dev1" >> "$seed_output"
3636
run_check_stdout $SUDO_HELPER "$TOP/btrfs" check "$dev2" >> "$sprouted_output"
3737

38-
# There should be no warning for both seed and sprouted fs
39-
if grep -q "WARNING" "$seed_output"; then
38+
# There should be no warning about the device size for both seed and sprouted fs
39+
if grep -q "fix-device-size" "$seed_output"; then
4040
cleanup_loopdevs
4141
rm -f -- "$seed_output" "$sprouted_output"
4242
_fail "false alerts detected for seed fs"
4343
fi
44-
if grep -q "WARNING" "$sprouted_output"; then
44+
if grep -q "fix-device-size" "$sprouted_output"; then
4545
cleanup_loopdevs
4646
rm -f -- "$seed_output" "$sprouted_output"
4747
_fail "false alerts detected for sprouted fs"

0 commit comments

Comments
 (0)