* [PATCH] btrfs: re-introduce 'norecovery' mount option
@ 2024-05-21 9:57 Qu Wenruo
2024-05-21 10:43 ` Johannes Thumshirn
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Qu Wenruo @ 2024-05-21 9:57 UTC (permalink / raw)
To: linux-btrfs; +Cc: Lennart Poettering, Jiri Slaby, stable
Although 'norecovery' mount option is marked deprecated for a long time
and a warning message is introduced during the deprecation window, it's
still actively utilized by several projects that need a safely way to
mount a btrfs without any writes.
Furthermore this 'norecovery' mount option is supported by most major
filesystems, which makes it harder to validate our motivation.
This patch would 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: https://github.com/systemd/systemd/pull/32892
Link: https://bugzilla.suse.com/show_bug.cgi?id=1222429
Reported-by: Lennart Poettering <lennart@poettering.net>
Reported-by: Jiri Slaby <jslaby@suse.com>
Fixes: a1912f712188 ("btrfs: remove code for inode_cache and recovery mount options")
Cc: stable@vger.kernel.org # 6.8+
Signed-off-by: Qu Wenruo <wqu@suse.com>
---
fs/btrfs/super.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 2dbc930a20f7..f05cce7c8b8d 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -119,6 +119,7 @@ enum {
Opt_thread_pool,
Opt_treelog,
Opt_user_subvol_rm_allowed,
+ Opt_norecovery,
/* Rescue options */
Opt_rescue,
@@ -245,6 +246,8 @@ static const struct fs_parameter_spec btrfs_fs_parameters[] = {
__fsparam(NULL, "nologreplay", Opt_nologreplay, fs_param_deprecated, NULL),
/* Deprecated, with alias rescue=usebackuproot */
__fsparam(NULL, "usebackuproot", Opt_usebackuproot, fs_param_deprecated, NULL),
+ /* For compatibility only, alias for "rescue=nologreplay". */
+ fsparam_flag("norecovery", Opt_norecovery),
/* Debugging options. */
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)
"'nologreplay' is deprecated, use 'rescue=nologreplay' instead");
btrfs_set_opt(ctx->mount_opt, NOLOGREPLAY);
break;
+ case Opt_norecovery:
+ btrfs_info(NULL,
+"'norecovery' is for compatibility only, recommended to use 'rescue=nologreplay'");
+ btrfs_set_opt(ctx->mount_opt, NOLOGREPLAY);
+ break;
case Opt_flushoncommit:
if (result.negated)
btrfs_clear_opt(ctx->mount_opt, FLUSHONCOMMIT);
--
2.45.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] btrfs: re-introduce 'norecovery' mount option
2024-05-21 9:57 [PATCH] btrfs: re-introduce 'norecovery' mount option Qu Wenruo
@ 2024-05-21 10:43 ` Johannes Thumshirn
2024-05-21 13:13 ` David Sterba
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Johannes Thumshirn @ 2024-05-21 10:43 UTC (permalink / raw)
To: Qu Wenruo, linux-btrfs@vger.kernel.org
Cc: Lennart Poettering, Jiri Slaby, stable@vger.kernel.org
Looks good,
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] btrfs: re-introduce 'norecovery' mount option
2024-05-21 9:57 [PATCH] btrfs: re-introduce 'norecovery' mount option Qu Wenruo
2024-05-21 10:43 ` Johannes Thumshirn
@ 2024-05-21 13:13 ` David Sterba
2024-05-21 13:24 ` Lennart Poettering
2024-05-21 13:26 ` David Sterba
3 siblings, 0 replies; 5+ messages in thread
From: David Sterba @ 2024-05-21 13:13 UTC (permalink / raw)
To: Qu Wenruo; +Cc: linux-btrfs, Lennart Poettering, Jiri Slaby, stable
On Tue, May 21, 2024 at 07:27:31PM +0930, Qu Wenruo wrote:
> Although 'norecovery' mount option is marked deprecated for a long time
> and a warning message is introduced during the deprecation window, it's
> still actively utilized by several projects that need a safely way to
> mount a btrfs without any writes.
>
> Furthermore this 'norecovery' mount option is supported by most major
> filesystems, which makes it harder to validate our motivation.
>
> This patch would 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: https://github.com/systemd/systemd/pull/32892
> Link: https://bugzilla.suse.com/show_bug.cgi?id=1222429
> Reported-by: Lennart Poettering <lennart@poettering.net>
> Reported-by: Jiri Slaby <jslaby@suse.com>
> Fixes: a1912f712188 ("btrfs: remove code for inode_cache and recovery mount options")
> Cc: stable@vger.kernel.org # 6.8+
> Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] btrfs: re-introduce 'norecovery' mount option
2024-05-21 9:57 [PATCH] btrfs: re-introduce 'norecovery' mount option Qu Wenruo
2024-05-21 10:43 ` Johannes Thumshirn
2024-05-21 13:13 ` David Sterba
@ 2024-05-21 13:24 ` Lennart Poettering
2024-05-21 13:26 ` David Sterba
3 siblings, 0 replies; 5+ messages in thread
From: Lennart Poettering @ 2024-05-21 13:24 UTC (permalink / raw)
To: Qu Wenruo; +Cc: linux-btrfs, Jiri Slaby, stable
On Di, 21.05.24 19:27, Qu Wenruo (wqu@suse.com) wrote:
thank you!
lgtm.
> Although 'norecovery' mount option is marked deprecated for a long time
> and a warning message is introduced during the deprecation window, it's
> still actively utilized by several projects that need a safely way to
> mount a btrfs without any writes.
>
> Furthermore this 'norecovery' mount option is supported by most major
> filesystems, which makes it harder to validate our motivation.
>
> This patch would 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: https://github.com/systemd/systemd/pull/32892
> Link: https://bugzilla.suse.com/show_bug.cgi?id=1222429
> Reported-by: Lennart Poettering <lennart@poettering.net>
> Reported-by: Jiri Slaby <jslaby@suse.com>
> Fixes: a1912f712188 ("btrfs: remove code for inode_cache and recovery mount options")
> Cc: stable@vger.kernel.org # 6.8+
> Signed-off-by: Qu Wenruo <wqu@suse.com>
> ---
> fs/btrfs/super.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index 2dbc930a20f7..f05cce7c8b8d 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -119,6 +119,7 @@ enum {
> Opt_thread_pool,
> Opt_treelog,
> Opt_user_subvol_rm_allowed,
> + Opt_norecovery,
>
> /* Rescue options */
> Opt_rescue,
> @@ -245,6 +246,8 @@ static const struct fs_parameter_spec btrfs_fs_parameters[] = {
> __fsparam(NULL, "nologreplay", Opt_nologreplay, fs_param_deprecated, NULL),
> /* Deprecated, with alias rescue=usebackuproot */
> __fsparam(NULL, "usebackuproot", Opt_usebackuproot, fs_param_deprecated, NULL),
> + /* For compatibility only, alias for "rescue=nologreplay". */
> + fsparam_flag("norecovery", Opt_norecovery),
>
> /* Debugging options. */
> 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)
> "'nologreplay' is deprecated, use 'rescue=nologreplay' instead");
> btrfs_set_opt(ctx->mount_opt, NOLOGREPLAY);
> break;
> + case Opt_norecovery:
> + btrfs_info(NULL,
> +"'norecovery' is for compatibility only, recommended to use 'rescue=nologreplay'");
> + btrfs_set_opt(ctx->mount_opt, NOLOGREPLAY);
> + break;
> case Opt_flushoncommit:
> if (result.negated)
> btrfs_clear_opt(ctx->mount_opt, FLUSHONCOMMIT);
> --
> 2.45.1
>
>
Lennart
--
Lennart Poettering, Berlin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] btrfs: re-introduce 'norecovery' mount option
2024-05-21 9:57 [PATCH] btrfs: re-introduce 'norecovery' mount option Qu Wenruo
` (2 preceding siblings ...)
2024-05-21 13:24 ` Lennart Poettering
@ 2024-05-21 13:26 ` David Sterba
3 siblings, 0 replies; 5+ messages in thread
From: David Sterba @ 2024-05-21 13:26 UTC (permalink / raw)
To: Qu Wenruo; +Cc: linux-btrfs, Lennart Poettering, Jiri Slaby, stable
On Tue, May 21, 2024 at 07:27:31PM +0930, Qu Wenruo wrote:
> Although 'norecovery' mount option is marked deprecated for a long time
> and a warning message is introduced during the deprecation window, it's
> still actively utilized by several projects that need a safely way to
> mount a btrfs without any writes.
>
> Furthermore this 'norecovery' mount option is supported by most major
> filesystems, which makes it harder to validate our motivation.
>
> This patch would 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: https://github.com/systemd/systemd/pull/32892
> Link: https://bugzilla.suse.com/show_bug.cgi?id=1222429
> Reported-by: Lennart Poettering <lennart@poettering.net>
> Reported-by: Jiri Slaby <jslaby@suse.com>
> Fixes: a1912f712188 ("btrfs: remove code for inode_cache and recovery mount options")
> Cc: stable@vger.kernel.org # 6.8+
> Signed-off-by: Qu Wenruo <wqu@suse.com>
I'll add it to for-next myself, there are a few more fixes that I
plan to send during merge window so this patch can be picked to stable
next week.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-05-21 13:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-21 9:57 [PATCH] btrfs: re-introduce 'norecovery' mount option Qu Wenruo
2024-05-21 10:43 ` Johannes Thumshirn
2024-05-21 13:13 ` David Sterba
2024-05-21 13:24 ` Lennart Poettering
2024-05-21 13:26 ` David Sterba
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox