From: Qu Wenruo <wqu@suse.com>
To: linux-btrfs@vger.kernel.org
Subject: [PATCH 0/3] btrfs: add parent-child ownership check
Date: Tue, 22 Feb 2022 15:41:18 +0800 [thread overview]
Message-ID: <cover.1645515599.git.wqu@suse.com> (raw)
Tree-checker doesn't really check owner except for empty leaf.
This allows parent-child ownership mismatch to sneak in.
Enhance the checks again tree block owner by:
- Add owner check when reading child tree blocks
- Make sure the tree root owner matches the root key
Unfortunately the check still has some cases missing, mostly for
- Log/reloc trees
Need full root key to check, which is not really possible for
some backref call sites.
The first 2 patches are just cleanup to unify the error handling
patterns, there are some "creative" way checking the errors, which is
not really reader friendly.
The last patch is doing the real work.
Qu Wenruo (3):
btrfs: unify the error handling pattern for read_tree_block()
btrfs: unify the error handling of btrfs_read_buffer()
btrfs: check extent buffer owner against the owner rootid
fs/btrfs/backref.c | 7 +++--
fs/btrfs/ctree.c | 48 +++++++++++++++++++---------------
fs/btrfs/disk-io.c | 37 +++++++++++++++++++++-----
fs/btrfs/print-tree.c | 4 +--
fs/btrfs/relocation.c | 3 ++-
fs/btrfs/tree-checker.c | 57 +++++++++++++++++++++++++++++++++++++++++
fs/btrfs/tree-checker.h | 1 +
7 files changed, 125 insertions(+), 32 deletions(-)
--
2.35.1
next reply other threads:[~2022-02-22 7:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-22 7:41 Qu Wenruo [this message]
2022-02-22 7:41 ` [PATCH 1/3] btrfs: unify the error handling pattern for read_tree_block() Qu Wenruo
2022-02-22 7:41 ` [PATCH 2/3] btrfs: unify the error handling of btrfs_read_buffer() Qu Wenruo
2022-02-22 7:41 ` [PATCH 3/3] btrfs: check extent buffer owner against the owner rootid Qu Wenruo
2022-03-04 16:25 ` Filipe Manana
2022-03-04 23:11 ` Qu Wenruo
2022-03-01 21:45 ` [PATCH 0/3] btrfs: add parent-child ownership check 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.1645515599.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox