]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
btrfs/053: fix test failure when running with btrfs-progs v6.0+
authorFilipe Manana <fdmanana@suse.com>
Wed, 9 Nov 2022 16:44:57 +0000 (16:44 +0000)
committerZorro Lang <zlang@kernel.org>
Wed, 23 Nov 2022 03:55:03 +0000 (11:55 +0800)
In btrfs-progs v6.0 the --leafsize (-l) command line option was removed
from mkfs.btrfs, so btrfs/053 can fail with v6.0+ in case the scratch
device does not have a btrfs filesystem created before running the test,
in which case mounting the scratch device fails.

The change was introduced by the following btrfs-progs commit:

  f7a768d62498 ("btrfs-progs: mkfs: remove support for option --leafsize")

Change the test to use --nodesize (-n) instead, since it exists in both
old and new btrfs-progs versions. Also redirect mkfs output to the test's
log file and fail explicitly if mkfs failed.

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/053

index fbd2e7d992cd78d93b20500efca34928e137cb7d..67239f10d3ab93ffe2a41a1f6518cfebdb2550e1 100755 (executable)
@@ -44,7 +44,7 @@ send_files_dir=$TEST_DIR/btrfs-test-$seq
 rm -fr $send_files_dir
 mkdir $send_files_dir
 
-_scratch_mkfs "-l $leaf_size" >/dev/null 2>&1
+_scratch_mkfs "--nodesize $leaf_size" >> $seqres.full 2>&1 || _fail "mkfs failed"
 _scratch_mount
 
 echo "hello world" > $SCRATCH_MNT/foobar
@@ -72,7 +72,7 @@ _run_btrfs_util_prog send -p $SCRATCH_MNT/mysnap1 -f $send_files_dir/2.snap \
 _scratch_unmount
 _check_scratch_fs
 
-_scratch_mkfs "-l $leaf_size" >/dev/null 2>&1
+_scratch_mkfs "--nodesize $leaf_size" >> $seqres.full 2>&1 || _fail "mkfs failed"
 _scratch_mount
 
 _run_btrfs_util_prog receive -f $send_files_dir/1.snap $SCRATCH_MNT