diff mbox series

[v4,5/8] btrfs: show rescue=usebackuproot in /proc/mounts

Message ID 007ef6e4d542210148bc373d3a432d801e83019e.1602862052.git.josef@toxicpanda.com (mailing list archive)
State New, archived
Headers show
Series New rescue mount options | expand

Commit Message

Josef Bacik Oct. 16, 2020, 3:29 p.m. UTC
This got missed somehow, so add it in.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/super.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Johannes Thumshirn Oct. 19, 2020, 8:18 a.m. UTC | #1
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
David Sterba Oct. 20, 2020, 4:03 p.m. UTC | #2
On Fri, Oct 16, 2020 at 11:29:17AM -0400, Josef Bacik wrote:
> This got missed somehow, so add it in.

No, that it's not in the list is intentional, see disk-io.c:

3348         /*
3349          * backuproot only affect mount behavior, and if open_ctree succeeded,
3350          * no need to keep the flag
3351          */
3352         btrfs_clear_opt(fs_info->mount_opt, USEBACKUPROOT);

so it would never reach show_options, but the question is if it should
be in the list. I'd vote for yes, it maybe made some sense for a
standalone option but now that it's a one of rescue, it should not
randomy disappear.
Josef Bacik Oct. 21, 2020, 2:02 p.m. UTC | #3
On 10/20/20 12:03 PM, David Sterba wrote:
> On Fri, Oct 16, 2020 at 11:29:17AM -0400, Josef Bacik wrote:
>> This got missed somehow, so add it in.
> 
> No, that it's not in the list is intentional, see disk-io.c:
> 
> 3348         /*
> 3349          * backuproot only affect mount behavior, and if open_ctree succeeded,
> 3350          * no need to keep the flag
> 3351          */
> 3352         btrfs_clear_opt(fs_info->mount_opt, USEBACKUPROOT);
> 
> so it would never reach show_options, but the question is if it should
> be in the list. I'd vote for yes, it maybe made some sense for a
> standalone option but now that it's a one of rescue, it should not
> randomy disappear.
> 

I think yes, especially since it's one of the rescue=<> options.  I'm not a big 
fan of mount options that don't get shown afterwards, we still probably want to 
know that the fs was mounted with the special option after the fact, rather than 
just clearing it after we're done with it.  I'll follow up to remove this part. 
  Thanks,

Josef
diff mbox series

Patch

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index f41f7af27ff7..ca270649fe10 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -1438,6 +1438,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))