]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
btrfs: remove redundant path release in btrfs_find_orphan_roots()
authorFilipe Manana <fdmanana@suse.com>
Tue, 16 Dec 2025 12:02:18 +0000 (12:02 +0000)
committerDavid Sterba <dsterba@suse.com>
Tue, 3 Feb 2026 06:49:11 +0000 (07:49 +0100)
There's no need to release the path in the if branch used when the root
does not exists since we released the path before the call to
btrfs_get_fs_root(). So remove that redundant btrfs_release_path() call.

Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.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/root-tree.c

index a7171112d638f64f9edbd68f60f37b2845411d1d..40f9bc9485e86b2e8bba94e3ae7a84a8d6997d17 100644 (file)
@@ -261,8 +261,6 @@ int btrfs_find_orphan_roots(struct btrfs_fs_info *fs_info)
                } else if (ret == -ENOENT) {
                        struct btrfs_trans_handle *trans;
 
-                       btrfs_release_path(path);
-
                        trans = btrfs_join_transaction(tree_root);
                        if (IS_ERR(trans)) {
                                ret = PTR_ERR(trans);