[PATCH] fstests: btrfs/053: use "-n" to replace the deprecated "-l" mkfs option

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



[BUG]
Test case btrfs/053 will fail if using newer btrfs-progs with the extra
error output:

    mount: /mnt/scratch: wrong fs type, bad option, bad superblock on /dev/mapper/test-scratch1, missing codepage or helper program, or other error.
           dmesg(1) may have more information after failed mount system call.
    mount /dev/mapper/test-scratch1 /mnt/scratch failed

[CAUSE]
The option "-l"/"--leafsize" is already marked deprecated since
btrfs-progs v4.0, and finally in btrfs-progs v6.0 we removes the support
for such deprecated option completely.

But unfortunately the test case is still using the old option.

[FIX]
Fix and improve the test case by:

- Use "-n" to replace the "-l" option

- Rename "leaf_size" variable to "node_size"

- Save the output of _scratch_mkfs to $seqres.full
  This would save quite some time if it later failed due to some other
  reasons in mkfs.btrfs.

Signed-off-by: Qu Wenruo <wqu@xxxxxxxx>
---
 tests/btrfs/053 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/btrfs/053 b/tests/btrfs/053
index fbd2e7d9..006ea0e6 100755
--- a/tests/btrfs/053
+++ b/tests/btrfs/053
@@ -37,14 +37,14 @@ _require_attrs
 # max(16384, PAGE_SIZE) is the default leaf/node size on btrfs-progs v3.12+.
 # Older versions just use max(4096, PAGE_SIZE).
 # mkfs.btrfs can't create an fs with a leaf/node size smaller than PAGE_SIZE.
-leaf_size=$(echo -e "16384\n`getconf PAGE_SIZE`" | sort -nr | head -1)
+node_size=$(echo -e "16384\n`getconf PAGE_SIZE`" | sort -nr | head -1)
 
 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 "-n $node_size" >> $seqres.full 2>&1
 _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 "-n $node_size" >> $seqres.full 2>&1
 _scratch_mount
 
 _run_btrfs_util_prog receive -f $send_files_dir/1.snap $SCRATCH_MNT
-- 
2.38.0




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux