btrfs: add "rescue=usebackuproot" into forced read-only options

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

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

Furthermore, a filesystem that requires "rescue=" mount option already
means it's corrupted, even if "rescue=usebackuproot" allowed the fs to
be mounted RW, one should not trust such fs anymore until a
comprehensive btrfs-check run and proper evaluation.

Change the behavior to match the document, and since
"rescue=usebackuproot" is now a full RO mount option, it is no longer a
one-shot option, therefore remove it from btrfs_clear_oneshot_options().

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Neal Gompa <neal@gompa.dev>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Qu Wenruo 2026-07-03 19:16:06 +09:30 • committed by David Sterba
commit ce5d6709eb
2 changed files with 4 additions and 3 deletions