]> www.infradead.org Git - users/hch/misc.git/commitdiff
btrfs: remove redundant path release when overwriting item during log replay
authorFilipe Manana <fdmanana@suse.com>
Tue, 2 Sep 2025 16:08:19 +0000 (17:08 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 23 Sep 2025 06:49:20 +0000 (08:49 +0200)
At overwrite_item() we have a redundant btrfs_release_path() just before
failing with -ENOMEM, as the caller who passed in the path will free it
and therefore also release any refcounts and locks on the extent buffers
of the path. So remove it.

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/tree-log.c

index 65b8858e82d1d74d26c0f567c1c4da81ed189857..66500ebdd35c77e9556ae4e678f69a4907e8d69a 100644 (file)
@@ -471,7 +471,6 @@ static int overwrite_item(struct walk_control *wc, struct btrfs_path *path)
                }
                src_copy = kmalloc(item_size, GFP_NOFS);
                if (!src_copy) {
-                       btrfs_release_path(path);
                        btrfs_abort_transaction(trans, -ENOMEM);
                        return -ENOMEM;
                }