]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
btrfs: pass a valid btrfs_tree_parent_check when possible
authorQu Wenruo <wqu@suse.com>
Thu, 9 Apr 2026 23:16:40 +0000 (08:46 +0930)
committerDavid Sterba <dsterba@suse.com>
Mon, 8 Jun 2026 13:53:27 +0000 (15:53 +0200)
commit79a15639bf28ed9ed5469da355331e16e5d3051f
tree63836df18c67bd8034dcbae1dfac34bb993c8d15
parent4549871118cf616eecdd2d939f78e3b9e1dddc48
btrfs: pass a valid btrfs_tree_parent_check when possible

Commit 6e181cfe2409 ("btrfs: revalidate cached tree blocks on the
uptodate path") introduced the @check parameter for
btrfs_buffer_uptodate() to allow re-validation of a cached extent
buffer.

But there are still call sites that don't utilize this parameter, which
exposes them to possible corrupted tree blocks, e.g. an empty child leaf
of a parent node, which should be rejected by btrfs_verify_level_key()
but if @check is NULL such check will be skipped and cause problems.

Thankfully for a lot of cases there is already an existing @check
structure around and we can pass it directly to btrfs_buffer_uptodate().

Reviewed-by: Boris Burkov <boris@bur.io>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.c
fs/btrfs/extent-tree.c
fs/btrfs/extent_io.c