All of lore.kernel.org
 help / color / mirror / Atom feed
From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/3] btrfs: tree-checker: enhanced fst extent/bitmap checks
Date: Mon, 11 May 2026 10:26:48 +0930	[thread overview]
Message-ID: <cover.1778460959.git.wqu@suse.com> (raw)

The first patch is a small cleanup to share more code and remove
duplications.

The second one is to avoid u64 overflow for the extent/bitmap/space info,
mostly to catch obviously corruptedd size.

The last one is the main part, introducing cross-key checks.

If the previous key is FREE_SPACE_INFO, make sure the current key is
inside the bg range, and matches the type the free space info is using.

If the previous key is FREE_SPACE_EXTENT/BITMAP, make sure the current
key doesn't overlap with the previous one, and type matches the previous
one. This will allow tree-checker to catch most (but not all) bad key
type flipping.

Qu Wenruo (3):
  btrfs: tree-checker: extract the shared key check for free space
    entries
  btrfs: tree-checker: ensure free space tree entries won't overflow
  btrfs: tree-checker: add more cross checks for free space tree

 fs/btrfs/tree-checker.c | 119 +++++++++++++++++++++++++++++++---------
 1 file changed, 93 insertions(+), 26 deletions(-)

-- 
2.54.0


             reply	other threads:[~2026-05-11  0:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11  0:56 Qu Wenruo [this message]
2026-05-11  0:56 ` [PATCH 1/3] btrfs: tree-checker: extract the shared key check for free space entries Qu Wenruo
2026-05-11  0:56 ` [PATCH 2/3] btrfs: tree-checker: ensure free space tree entries won't overflow Qu Wenruo
2026-05-11  0:56 ` [PATCH 3/3] btrfs: tree-checker: add more cross checks for free space tree Qu Wenruo
2026-05-15 16:31 ` [PATCH 0/3] btrfs: tree-checker: enhanced fst extent/bitmap checks David Sterba

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=cover.1778460959.git.wqu@suse.com \
    --to=wqu@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.