From: Filipe Manana Date: Tue, 18 Jun 2024 12:09:39 +0000 (+0100) Subject: btrfs: remove superfluous metadata check at btrfs_lookup_extent_info() X-Git-Tag: v6.11-rc1~157^2~45 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c65967ac4d1668dfcb903215c8af128fa15f05d6;p=thirdparty%2Fkernel%2Flinux.git btrfs: remove superfluous metadata check at btrfs_lookup_extent_info() If we didn't found an extent item with the initial btrfs_search_slot() call, it's pointless to test if the "metadata" variable is "true", because right after we check if the key type is BTRFS_METADATA_ITEM_KEY and that is the case only when "metadata" is set to "true". So remove the redundant check. Reviewed-by: Qu Wenruo Signed-off-by: Filipe Manana Signed-off-by: David Sterba --- diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 21d123d392c00..a14d2a74d7fdd 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -139,7 +139,7 @@ search_again: if (ret < 0) goto out_free; - if (ret > 0 && metadata && key.type == BTRFS_METADATA_ITEM_KEY) { + if (ret > 0 && key.type == BTRFS_METADATA_ITEM_KEY) { if (path->slots[0]) { path->slots[0]--; btrfs_item_key_to_cpu(path->nodes[0], &key,