public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: ZhengYuan Huang <gality369@gmail.com>,
	dsterba@suse.com, clm@fb.com, zheng.yan@oracle.com
Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	baijiaju1990@gmail.com, r33s3n6@gmail.com, zzzccc427@gmail.com
Subject: Re: [PATCH v2] btrfs: reject empty non-root tree blocks at read time
Date: Thu, 9 Apr 2026 18:39:59 +0930	[thread overview]
Message-ID: <baea8ced-c1c2-4a2b-810e-30c957c50498@suse.com> (raw)
In-Reply-To: <20260409081140.3400650-1-gality369@gmail.com>



在 2026/4/9 17:41, ZhengYuan Huang 写道:
> 
> [CAUSE]
> The old btrfs_verify_level_key() path rejected tree blocks with
> nritems == 0 whenever the parent check provided a first key.
> Commit 947a629988f1 ("btrfs: move tree block parentness check into
> validate_extent_buffer()") moved the parentness checks into the read-time
> validation path, but it dropped that guard. This lets an empty non-root
> tree block pass read-time validation even though slot 0 must exist if the
> parent provides a first key.

Wait for a second, there is still the nritems == 0 check inside 
btrfs_verify_level_key().

It looks like there is a missing link.

Is the btrfs_buffer_uptodate() call inside read_block_for_search() not 
passing the correct check structure?

Thanks,
Qu

  reply	other threads:[~2026-04-09  9:10 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-09  8:11 [PATCH v2] btrfs: reject empty non-root tree blocks at read time ZhengYuan Huang
2026-04-09  9:09 ` Qu Wenruo [this message]
2026-04-09  9:38   ` Qu Wenruo
2026-04-12  3:29 ` kernel test robot
2026-04-12  4:07 ` kernel test robot
2026-04-12  4:53 ` kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=baea8ced-c1c2-4a2b-810e-30c957c50498@suse.com \
    --to=wqu@suse.com \
    --cc=baijiaju1990@gmail.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=gality369@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=r33s3n6@gmail.com \
    --cc=zheng.yan@oracle.com \
    --cc=zzzccc427@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox