]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
btrfs: deal with missing root in sample_block_group_extent_item()
authorFilipe Manana <fdmanana@suse.com>
Wed, 21 Jan 2026 20:48:35 +0000 (20:48 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 3 Feb 2026 06:56:19 +0000 (07:56 +0100)
commita8bec25e014eab671ec8a25b03d391cad3e55230
tree90aa9a440e5c1bd17536dba6894d54b2e245c2f6
parent79d51b5c7a2c64f3420ff632df67a76bf01a46ed
btrfs: deal with missing root in sample_block_group_extent_item()

In case the root does not exists, which is unexpected, btrfs_extent_root()
returns NULL, but we ignore that and so if it happens we can trigger a
NULL pointer dereference later. So verify if we found the root and log an
error message in case it's missing.

Reviewed-by: Boris Burkov <boris@bur.io>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/block-group.c