Skip to content

btrfs: add parent-child ownership check

Qu Wenruo linux-btrfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3btrfs: unify the error handling pattern for read_tree_block()fs/btrfs/backref.c fs/btrfs/ctree.c fs/btrfs/disk-io.c +2 more+34 -260 replies
2/3btrfs: unify the error handling of btrfs_read_buffer()fs/btrfs/ctree.c+6 -60 replies
3/3btrfs: check extent buffer owner against the owner rootidfs/btrfs/ctree.c fs/btrfs/disk-io.c fs/btrfs/tree-checker.c +1 more+85 -02 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] btrfs: add parent-child ownership check

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(-)
Signature · 1 line
2.35.1