Re: [PATCH] btrfs: treat empty left leaf as corruption in push_leaf_left()
From: ZhengYuan Huang
Date: Thu Apr 09 2026 - 04:06:52 EST
On Thu, Apr 9, 2026 at 3:51 PM Qu Wenruo <wqu@xxxxxxxx> wrote:
> I think the timing is too late, and if there is an non-root empty leaf
> but we never modified it, kernel will not detect it.
>
> I'd recommend to reject such empty leaves at
> btrfs_validate_extent_buffer(), if we have check->has_first_key, then
> the leaf should not be empty.
>
> Thanks,
> Qu
> >
> > free_space = btrfs_leaf_free_space(left);
> > if (free_space < data_size) {
Thanks for your suggestion. That makes sense.
I will send a v2 patch incorporating this change.
Thanks,
ZhengYuan Huang