Skip to content

Commit 440861b

Browse files
adam900710kdave
authored andcommitted
btrfs: re-introduce 'norecovery' mount option
Although 'norecovery' mount option was marked as deprecated for a long time and a warning message was printed during the deprecation window, it's still actively utilized by several projects that need a safer way to mount a btrfs without any writes. Furthermore this 'norecovery' mount option is supported by other major filesystems, which makes it less clear what's our motivation to remove it. Re-introduce the 'norecovery' mount option, and output a message to recommend 'rescue=nologreplay' option. Link: https://lore.kernel.org/linux-btrfs/ZkxZT0J-z0GYvfy8@gardel-login/#t Link: systemd/systemd#32892 Link: https://bugzilla.suse.com/show_bug.cgi?id=1222429 Reported-by: Lennart Poettering <[email protected]> Reported-by: Jiri Slaby <[email protected]> Fixes: a1912f7 ("btrfs: remove code for inode_cache and recovery mount options") CC: [email protected] # 6.8+ Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Qu Wenruo <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent dddff82 commit 440861b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

fs/btrfs/super.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ enum {
119119
Opt_thread_pool,
120120
Opt_treelog,
121121
Opt_user_subvol_rm_allowed,
122+
Opt_norecovery,
122123

123124
/* Rescue options */
124125
Opt_rescue,
@@ -245,6 +246,8 @@ static const struct fs_parameter_spec btrfs_fs_parameters[] = {
245246
__fsparam(NULL, "nologreplay", Opt_nologreplay, fs_param_deprecated, NULL),
246247
/* Deprecated, with alias rescue=usebackuproot */
247248
__fsparam(NULL, "usebackuproot", Opt_usebackuproot, fs_param_deprecated, NULL),
249+
/* For compatibility only, alias for "rescue=nologreplay". */
250+
fsparam_flag("norecovery", Opt_norecovery),
248251

249252
/* Debugging options. */
250253
fsparam_flag_no("enospc_debug", Opt_enospc_debug),
@@ -438,6 +441,11 @@ static int btrfs_parse_param(struct fs_context *fc, struct fs_parameter *param)
438441
"'nologreplay' is deprecated, use 'rescue=nologreplay' instead");
439442
btrfs_set_opt(ctx->mount_opt, NOLOGREPLAY);
440443
break;
444+
case Opt_norecovery:
445+
btrfs_info(NULL,
446+
"'norecovery' is for compatibility only, recommended to use 'rescue=nologreplay'");
447+
btrfs_set_opt(ctx->mount_opt, NOLOGREPLAY);
448+
break;
441449
case Opt_flushoncommit:
442450
if (result.negated)
443451
btrfs_clear_opt(ctx->mount_opt, FLUSHONCOMMIT);

0 commit comments

Comments
 (0)