Re: [PATCH v2 0/3] btrfs: handle missing block group and raid stripe tree roots

Qu Wenruo <[email protected]>
Newsgroups org.kernel.vger.linux-btrfs
Message-ID <[email protected]>

在 2026/7/13 18:20, Dongjiang Zhu 写道:
> The rescue=ignorebadroots mount option allows mounting to continue when
> some tree roots cannot be loaded. For the block group tree and raid stripe
> tree, this leaves the corresponding root pointer NULL while the on-disk
> feature bit remains set.
> 
> btrfs_update_global_block_rsv() accounts both trees based only on their
> feature bits, so it dereferences the missing root while mounting. Rescue
> mounts are fully read-only and cannot start transactions, so they do not
> need a real global block reserve.
> 
> This series moves the full read-only helper to fs.h and uses it to skip
> global reserve accounting for rescue mounts. It also reports a missing
> raid stripe tree root explicitly if a later data read requires a raid
> stripe lookup.
> 
> Changes in v2:
> - Replace the per-root NULL checks with a dummy global block reserve for
>    full read-only mounts, as suggested by Qu Wenruo.
> - Move and rename fs_is_full_ro() so the global reserve code can use it.
> 
> v1:
> https://lore.kernel.org/linux-btrfs/[email protected]/

Looks good to me overall.

Reviewed-by: Qu Wenruo <[email protected]>

> 
> Dongjiang Zhu (3):
>    btrfs: move the full read-only helper to fs.h
>    btrfs: skip global block reserve accounting for rescue mounts

I'll squash the btrfs_is_full_ro() commit into this one, as that is the 
only commit utilizing it.

I can do this at merge time so no need to refresh the series.

Thanks,
Qu

>    btrfs: report missing raid stripe tree root during lookup
> 
>   fs/btrfs/block-rsv.c        | 19 +++++++++++++++++--
>   fs/btrfs/disk-io.c          | 11 +----------
>   fs/btrfs/fs.h               |  9 +++++++++
>   fs/btrfs/raid-stripe-tree.c |  7 +++++++
>   4 files changed, 34 insertions(+), 12 deletions(-)
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.