btrfs: show rescue=usebackuproot in /proc/mounts
authorJosef Bacik <josef@toxicpanda.com>
Fri, 16 Oct 2020 15:29:17 +0000 (11:29 -0400)
committerDavid Sterba <dsterba@suse.com>
Tue, 8 Dec 2020 14:53:41 +0000 (15:53 +0100)
The standalone option usebackuproot was intended as one-time use and it
was not necessary to keep it in the option list. Now that we're going to
have more rescue options, it's desirable to keep them intact as it could
be confusing why the option disappears.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
[ remove the btrfs_clear_opt part from open_ctree ]
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c
fs/btrfs/super.c

index e3caf18..137c4d5 100644 (file)
@@ -3384,12 +3384,6 @@ int __cold open_ctree(struct super_block *sb, struct btrfs_fs_devices *fs_device
        }
        set_bit(BTRFS_FS_OPEN, &fs_info->flags);
 
-       /*
-        * backuproot only affect mount behavior, and if open_ctree succeeded,
-        * no need to keep the flag
-        */
-       btrfs_clear_opt(fs_info->mount_opt, USEBACKUPROOT);
-
        return 0;
 
 fail_qgroup:
index c5095a2..b9d5d61 100644 (file)
@@ -1437,6 +1437,8 @@ static int btrfs_show_options(struct seq_file *seq, struct dentry *dentry)
                seq_puts(seq, ",notreelog");
        if (btrfs_test_opt(info, NOLOGREPLAY))
                print_rescue_option(seq, "nologreplay", &printed);
+       if (btrfs_test_opt(info, USEBACKUPROOT))
+               print_rescue_option(seq, "usebackuproot", &printed);
        if (btrfs_test_opt(info, FLUSHONCOMMIT))
                seq_puts(seq, ",flushoncommit");
        if (btrfs_test_opt(info, DISCARD_SYNC))