Re: [PATCH] btrfs: reject root items with drop_progress and zero drop_level

From: ZhengYuan Huang

Date: Wed Mar 11 2026 - 20:03:15 EST


On Thu, Mar 12, 2026 at 5:08 AM Qu Wenruo <quwenruo.btrfs@xxxxxxx> wrote:
> > [FIX]
> > Fix this by validating the root_item invariant in tree-checker when
> > reading root items from disk: if drop_progress.objectid is non-zero,
> > drop_level must also be non-zero. Reject such malformed metadata with
> > -EUCLEAN before it reaches merge_reloc_root() or btrfs_drop_snapshot()
> > and triggers the BUG_ON.
> >
> > Also fix the related tree-checker error message to report
> > "invalid root drop_level" instead of the misleading "invalid root level".
>
> The only "fix" part I can see is the fix of the message from drop_level.
>
> If you really want to do that, please send out a fix dedicated for that
> single line.
>
> Otherwise you're adding a new check. Please do not mix fix and new check
> into one patch.

Thanks for the feedback.
I'll split the message fix and the new validation check into separate
patches and resend them.

Thanks,
ZhengYuan Huang