]> git.hungrycats.org Git - linux/commitdiff
btrfs: remove redundant eb generation check in btrfs_buffer_uptodate()
authorFilipe Manana <fdmanana@suse.com>
Wed, 16 Sep 2026 16:20:52 +0000 (17:20 +0100)
committerDavid Sterba <dsterba@suse.com>
Thu, 17 Sep 2026 16:20:41 +0000 (18:20 +0200)
It's pointless to check if the extent buffer's generation does not match
the value of 'parent_transid' because if it does, then we have already
entered the previous if statement and returned from the function.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/disk-io.c

index 21b72c90bd90f93cba59389e9c9409de58f5ad29..161a7b9bb27a5d85cb0ea344bd93a74b464fabdd 100644 (file)
@@ -125,15 +125,13 @@ int btrfs_buffer_uptodate(struct extent_buffer *eb, u64 parent_transid,
                return 1;
        }
 
-       if (btrfs_header_generation(eb) != parent_transid) {
-               btrfs_err_rl(eb->fs_info,
+       btrfs_err_rl(eb->fs_info,
 "parent transid verify failed on logical %llu mirror %u wanted %llu found %llu",
-                       eb->start, eb->read_mirror,
-                       parent_transid, btrfs_header_generation(eb));
-               clear_extent_buffer_uptodate(eb);
-               return 0;
-       }
-       return 1;
+                    eb->start, eb->read_mirror,
+                    parent_transid, btrfs_header_generation(eb));
+       clear_extent_buffer_uptodate(eb);
+
+       return 0;
 }
 
 static bool btrfs_supported_super_csum(u16 csum_type)