From: Filipe Manana Date: Sun, 8 Feb 2026 18:42:13 +0000 (+0000) Subject: btrfs: remove bogus root search condition in load_extent_tree_free() X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c9e39e92e4aab403df5004cbaa5be000e1db63bf;p=thirdparty%2Fkernel%2Flinux.git btrfs: remove bogus root search condition in load_extent_tree_free() There's no need to pass the maximum between the block group's start offset and BTRFS_SUPER_INFO_OFFSET (64K) since we can't have any block groups allocated in the first megabyte, as that's reserved space. Furthermore, even if we could, the correct thing to do was to pass the block group's start offset anyway - and that's precisely what we do for block groups hat happen to contain a superblock mirror (the range for the super block is never marked as free and it's marked as dirty in the fs_info->excluded_extents io tree). So simplify this and get rid of that maximum expression. Reviewed-by: Boris Burkov Signed-off-by: Filipe Manana Reviewed-by: David Sterba Signed-off-by: David Sterba --- diff --git a/fs/btrfs/block-group.c b/fs/btrfs/block-group.c index 9f4db25f7b86c..d21df4446e3d8 100644 --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -728,7 +728,7 @@ static int load_extent_tree_free(struct btrfs_caching_control *caching_ctl) struct extent_buffer *leaf; struct btrfs_key key; u64 total_found = 0; - u64 last = 0; + u64 last = block_group->start; u32 nritems; int ret; bool wakeup = true; @@ -737,7 +737,6 @@ static int load_extent_tree_free(struct btrfs_caching_control *caching_ctl) if (!path) return -ENOMEM; - last = max_t(u64, block_group->start, BTRFS_SUPER_INFO_OFFSET); extent_root = btrfs_extent_root(fs_info, last); if (unlikely(!extent_root)) { btrfs_err(fs_info,