Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: "Dongjiang Zhu" <zhudongjiang@fnnas.com>
To: "Qu Wenruo" <wqu@suse.com>, <linux-btrfs@vger.kernel.org>
Subject: Re: [PATCH v2 1/3] btrfs: add "rescue=usebackuproot" into forced read-only options
Date: Fri, 3 Jul 2026 17:21:15 +0800	[thread overview]
Message-ID: <c20f62ae-eef2-4eb5-9290-a7bebe6a259d@fnnas.com> (raw)
In-Reply-To: <dc5a344a2f4fcb63f78cb3e95beb1efbee9928f4.1783068013.git.wqu@suse.com>

在 2026/7/3 16:41, 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.
>
> 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") ||

Hi Qu,

One more thing I noticed: should BTRFS_MOUNT_USEBACKUPROOT also be added
to BTRFS_MOUNT_FULL_RO_MASK?

Thanks,
Dongjiang

  reply	other threads:[~2026-07-03  9:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-03  8:41 [PATCH v2 0/3] btrfs: small changes to "usebackuproot" mount Qu Wenruo
2026-07-03  8:41 ` [PATCH v2 1/3] btrfs: add "rescue=usebackuproot" into forced read-only options Qu Wenruo
2026-07-03  9:21   ` Dongjiang Zhu [this message]
2026-07-03  9:28     ` Qu Wenruo
2026-07-03  8:41 ` [PATCH v2 2/3] btrfs: add "rescue=usebackuproot" into "rescue=all" shortcut Qu Wenruo
2026-07-03  8:41 ` [PATCH v2 3/3] btrfs: remove "usebackuproot" mount option Qu Wenruo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c20f62ae-eef2-4eb5-9290-a7bebe6a259d@fnnas.com \
    --to=zhudongjiang@fnnas.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=wqu@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox