]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
btrfs: fix failure of tests that use defrag on btrfs-progs v6.0+
authorFilipe Manana <fdmanana@suse.com>
Wed, 9 Nov 2022 16:44:58 +0000 (16:44 +0000)
committerZorro Lang <zlang@kernel.org>
Wed, 23 Nov 2022 03:55:03 +0000 (11:55 +0800)
Starting with btrfs-progs v6.0, the defrag command now prints to stdout
the full path of the files it processes. This makes test cases btrfs/021
and btrfs/256 fail because they don't expect any output from the defrag
command.

The change happened with the following commit in btrfs-progs:

  dd724f21803d ("btrfs-progs: add logic to handle LOG_DEFAULT messages")

So update the tests to ignore the stdout of the defrag command.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/btrfs/021
tests/btrfs/256

index 5943da2f0c2b6e6f98da8cd13725e253d7152820..1b55834aa99cd6ffed08d006312b60ffa2f12e15 100755 (executable)
@@ -22,8 +22,10 @@ run_test()
 
        sleep 0.5
 
+       # In new versions of btrfs-progs (6.0+), the defrag command outputs to
+       # stdout the path of the files it operates on. So ignore that.
        find $SCRATCH_MNT -type f -print0 | xargs -0 \
-       $BTRFS_UTIL_PROG filesystem defrag -f
+               $BTRFS_UTIL_PROG filesystem defrag -f > /dev/null
 
        sync
        wait
index 1360c2c2021d8d21c11f316c9df7908fe0c51928..acbbc6fa5d4c0f16f3a5bb010b1188b42f2daee9 100755 (executable)
@@ -50,7 +50,9 @@ $FSSUM_PROG -A -f -w "$checksums_file" "$SCRATCH_MNT"
 # Now defrag each file.
 for sz in ${file_sizes[@]}; do
        echo "Defragging file with $sz bytes..." >> $seqres.full
-       $BTRFS_UTIL_PROG filesystem defragment "$SCRATCH_MNT/f_$sz"
+       # In new versions of btrfs-progs (6.0+), the defrag command outputs to
+       # stdout the path of the files it operates on. So ignore that.
+       $BTRFS_UTIL_PROG filesystem defragment "$SCRATCH_MNT/f_$sz" > /dev/null
 done
 
 # Verify the checksums after the defrag operations.