Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/2] btrfs: small changes to "usebackuproot" mount
@ 2026-07-02 23:40 Qu Wenruo
  2026-07-02 23:40 ` [PATCH 1/2] btrfs: add "rescue=usebackuproot" into forced read-only options Qu Wenruo
  2026-07-02 23:40 ` [PATCH 2/2] btrfs: remove "usebackuproot" mount option Qu Wenruo
  0 siblings, 2 replies; 5+ messages in thread
From: Qu Wenruo @ 2026-07-02 23:40 UTC (permalink / raw)
  To: linux-btrfs

"rescue=usebackuproot" mount option is not requiring a read-only mount,
which is different from all the other options in the "rescue=" group.
Address that in the first patch.

Standalone "usebackuproot" mount option is already marked deprecated
since v5.9, I see no practical reason to keep supporting it in 2026.
Just remove it in the second patch.

Qu Wenruo (2):
  btrfs: add "rescue=usebackuproot" into forced read-only options
  btrfs: remove "usebackuproot" mount option

 fs/btrfs/super.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

-- 
2.54.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] btrfs: add "rescue=usebackuproot" into forced read-only options
  2026-07-02 23:40 [PATCH 0/2] btrfs: small changes to "usebackuproot" mount Qu Wenruo
@ 2026-07-02 23:40 ` Qu Wenruo
  2026-07-03  2:33   ` Dongjiang Zhu
  2026-07-02 23:40 ` [PATCH 2/2] btrfs: remove "usebackuproot" mount option Qu Wenruo
  1 sibling, 1 reply; 5+ messages in thread
From: Qu Wenruo @ 2026-07-02 23:40 UTC (permalink / raw)
  To: linux-btrfs

According to btrfs(5) man page, all rescue options should require an
read-only mount.

But that read-only check is only introduced for newer rescue options,
not for the pre-existing "usebackuproot" one.

Unify the behavior to match the document.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 fs/btrfs/super.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 0a6ce6c19d8c..fef9025a2f76 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -692,7 +692,8 @@ bool btrfs_check_options(const struct btrfs_fs_info *info,
 	bool ret = true;
 
 	if (!(flags & SB_RDONLY) &&
-	    (check_ro_option(info, *mount_opt, BTRFS_MOUNT_NOLOGREPLAY, "nologreplay") ||
+	    (check_ro_option(info, *mount_opt, BTRFS_MOUNT_USEBACKUPROOT, "usebackuproot") ||
+	     check_ro_option(info, *mount_opt, BTRFS_MOUNT_NOLOGREPLAY, "nologreplay") ||
 	     check_ro_option(info, *mount_opt, BTRFS_MOUNT_IGNOREBADROOTS, "ignorebadroots") ||
 	     check_ro_option(info, *mount_opt, BTRFS_MOUNT_IGNOREDATACSUMS, "ignoredatacsums") ||
 	     check_ro_option(info, *mount_opt, BTRFS_MOUNT_IGNOREMETACSUMS, "ignoremetacsums") ||
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH 2/2] btrfs: remove "usebackuproot" mount option
  2026-07-02 23:40 [PATCH 0/2] btrfs: small changes to "usebackuproot" mount Qu Wenruo
  2026-07-02 23:40 ` [PATCH 1/2] btrfs: add "rescue=usebackuproot" into forced read-only options Qu Wenruo
@ 2026-07-02 23:40 ` Qu Wenruo
  1 sibling, 0 replies; 5+ messages in thread
From: Qu Wenruo @ 2026-07-02 23:40 UTC (permalink / raw)
  To: linux-btrfs

This mount option is marked deprecated since the introduction of
"rescue=" mount option group, in v5.9.

That's already a long long time ago, and it should be safe to completely
remove the old "usebackuproot" mount option now.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 fs/btrfs/super.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index fef9025a2f76..f2b3a85885f7 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -128,7 +128,6 @@ enum {
 
 	/* Rescue options */
 	Opt_rescue,
-	Opt_usebackuproot,
 
 	/* Debugging options */
 	Opt_enospc_debug,
@@ -248,8 +247,6 @@ static const struct fs_parameter_spec btrfs_fs_parameters[] = {
 
 	/* Rescue options. */
 	fsparam_enum("rescue", Opt_rescue, btrfs_parameter_rescue),
-	/* 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),
 
@@ -560,14 +557,6 @@ static int btrfs_parse_param(struct fs_context *fc, struct fs_parameter *param)
 		else
 			btrfs_set_opt(ctx->mount_opt, AUTO_DEFRAG);
 		break;
-	case Opt_usebackuproot:
-		btrfs_warn(NULL,
-			   "'usebackuproot' is deprecated, use 'rescue=usebackuproot' instead");
-		btrfs_set_opt(ctx->mount_opt, USEBACKUPROOT);
-
-		/* If we're loading the backup roots we can't trust the space cache. */
-		btrfs_set_opt(ctx->mount_opt, CLEAR_CACHE);
-		break;
 	case Opt_skip_balance:
 		btrfs_set_opt(ctx->mount_opt, SKIP_BALANCE);
 		break;
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] btrfs: add "rescue=usebackuproot" into forced read-only options
  2026-07-02 23:40 ` [PATCH 1/2] btrfs: add "rescue=usebackuproot" into forced read-only options Qu Wenruo
@ 2026-07-03  2:33   ` Dongjiang Zhu
  2026-07-03  3:19     ` Qu Wenruo
  0 siblings, 1 reply; 5+ messages in thread
From: Dongjiang Zhu @ 2026-07-03  2:33 UTC (permalink / raw)
  To: Qu Wenruo, linux-btrfs

在 2026/7/3 7:40, Qu Wenruo 写道:
> According to btrfs(5) man page, all rescue options should require an
> read-only mount.
>
> But that read-only check is only introduced for newer rescue options,
> not for the pre-existing "usebackuproot" one.
>
> Unify the behavior to match the document.
> [...]

Hi Qu,

Just a small note from looking at this together with my CLEAR_CACHE patch.

If rescue=usebackuproot requires a read-only mount, my patch to set
CLEAR_CACHE for it may no longer be needed.

Also, should rescue=all include usebackuproot too?

Thanks,
Dongjiang

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] btrfs: add "rescue=usebackuproot" into forced read-only options
  2026-07-03  2:33   ` Dongjiang Zhu
@ 2026-07-03  3:19     ` Qu Wenruo
  0 siblings, 0 replies; 5+ messages in thread
From: Qu Wenruo @ 2026-07-03  3:19 UTC (permalink / raw)
  To: Dongjiang Zhu, Qu Wenruo, linux-btrfs



在 2026/7/3 12:03, Dongjiang Zhu 写道:
> 在 2026/7/3 7:40, Qu Wenruo 写道:
>> According to btrfs(5) man page, all rescue options should require an
>> read-only mount.
>>
>> But that read-only check is only introduced for newer rescue options,
>> not for the pre-existing "usebackuproot" one.
>>
>> Unify the behavior to match the document.
>> [...]
> 
> Hi Qu,
> 
> Just a small note from looking at this together with my CLEAR_CACHE patch.
> 
> If rescue=usebackuproot requires a read-only mount, my patch to set
> CLEAR_CACHE for it may no longer be needed.

Yes, this patchset is inspired by your patch.

> 
> Also, should rescue=all include usebackuproot too?

That's a good catch.

I'll add a patch to add that into the series.

Thanks,
Qu

> 
> Thanks,
> Dongjiang
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-07-03  3:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-02 23:40 [PATCH 0/2] btrfs: small changes to "usebackuproot" mount Qu Wenruo
2026-07-02 23:40 ` [PATCH 1/2] btrfs: add "rescue=usebackuproot" into forced read-only options Qu Wenruo
2026-07-03  2:33   ` Dongjiang Zhu
2026-07-03  3:19     ` Qu Wenruo
2026-07-02 23:40 ` [PATCH 2/2] btrfs: remove "usebackuproot" mount option Qu Wenruo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox