[PATCH 1/2] btrfs: add "rescue=usebackuproot" into forced read-only options
Qu Wenruo <[email protected]>
| Newsgroups | org.kernel.vger.linux-btrfs |
|---|---|
| Message-ID | <dc5a344a2f4fcb63f78cb3e95beb1efbee9928f4.1783035512.git.wqu@suse.com> |
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 <[email protected]> --- 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