]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
fstests: btrfs/220: do not use nologreplay when possible
authorQu Wenruo <wqu@suse.com>
Tue, 13 May 2025 07:07:49 +0000 (16:37 +0930)
committerZorro Lang <zlang@kernel.org>
Fri, 23 May 2025 15:39:02 +0000 (23:39 +0800)
[BUG]
If the system is using mount from util-linux 2.41 or newer, the test
case will fail with the following error:

  FSTYP         -- btrfs
  PLATFORM      -- Linux/x86_64 btrfs-vm 6.15.0-rc5-custom+ #238 SMP PREEMPT_DYNAMIC Wed May  7 14:10:51 ACST 2025
  MKFS_OPTIONS  -- /dev/mapper/test-scratch1
  MOUNT_OPTIONS -- /dev/mapper/test-scratch1 /mnt/scratch

  btrfs/220 6s ... - output mismatch (see /home/adam/xfstests/results//btrfs/220.out.bad)
      --- tests/btrfs/220.out 2022-05-11 11:25:30.749999997 +0930
      +++ /home/adam/xfstests/results//btrfs/220.out.bad 2025-05-13 16:26:18.068521503 +0930
      @@ -1,2 +1,4 @@
       QA output created by 220
      +mount warning:
      +      * btrfs: Deprecated parameter 'nologreplay'
       Silence is golden
      ...
      (Run 'diff -u /home/adam/xfstests/tests/btrfs/220.out /home/adam/xfstests/results//btrfs/220.out.bad'  to see the entire diff)
  Ran: btrfs/220
  Failures: btrfs/220
  Failed 1 of 1 tests

[CAUSE]
The newer mount command provides the extra ability to show warning during
mount.

Although btrfs still supports "nologreplay" mount option to keep
consistency with other filesystems, we will output a warning and
encourage users to use "rescue=nologreplay" instead.

During "nologreplay" mount option test, normally we will mount use
the newer "rescue=nologreplay" mount option if the kernel supports.

But the following two call sites are still unconditionally utilizing
the deprecated "nologreplay" mount option directly:

- Expected failure when using nologreplay and rw mount

- Mount option verification that "nologreplay" is converted to
  "rescue=nologreplay"

The second call site caused the above mount warning message and fail the
test case.

[FIX]
If the kernel supports "rescue=nologreplay" we should not utilized
"nologreplay" at all.

This will avoid the mount warning on the deprecated and discouraged
"nologreplay" mount option.

Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
tests/btrfs/220

index 59d72a972fdd169b8a5b4165f242d2317693df00..4e91b9a7f1b7c93a59f0b0dc4682518c56060fa1 100755 (executable)
@@ -202,16 +202,13 @@ test_non_revertible_options()
 {
        test_mount_opt "degraded" "degraded"
 
-       # nologreplay should be used only with readonly
-       test_should_fail "nologreplay"
-
        if [ "$enable_rescue_nologreplay" = true ]; then
                #rescue=nologreplay should be used only with readonly
                test_should_fail "rescue=nologreplay"
-
-               test_mount_opt "nologreplay,ro" "ro,rescue=nologreplay"
                test_mount_opt "rescue=nologreplay,ro" "ro,rescue=nologreplay"
        else
+               # nologreplay should be used only with readonly
+               test_should_fail "nologreplay"
                test_mount_opt "nologreplay,ro" "ro,nologreplay"
        fi