aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
authorFilipe Manana <fdmanana@suse.com>2025-08-27 12:10:28 +0100
committerDavid Sterba <dsterba@suse.com>2025-09-23 08:49:18 +0200
commit2f5b8095ea47b142c56c09755a8b1e14145a2d30 (patch)
tree98688fc65a247bcbd4f5fe218eba27071e4531cb /fs/btrfs/tree-log.c
parentbtrfs: stop setting log_root_tree->log_root to NULL in btrfs_recover_log_trees() (diff)
downloadlinux-rng-2f5b8095ea47b142c56c09755a8b1e14145a2d30.tar.xz
linux-rng-2f5b8095ea47b142c56c09755a8b1e14145a2d30.zip
btrfs: always drop log root tree reference in btrfs_replay_log()
Currently we have this odd behaviour: 1) At btrfs_replay_log() we drop the reference of the log root tree if the call to btrfs_recover_log_trees() failed; 2) But if the call to btrfs_recover_log_trees() did not fail, we don't drop the reference in btrfs_replay_log() - we expect that btrfs_recover_log_trees() does it in case it returns success. Let's simplify this and make btrfs_replay_log() always drop the reference on the log root tree, not only this simplifies code as it's what makes sense since it's btrfs_replay_log() who grabbed the reference in the first place. Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index ab2f6bab096b..4d34aee0cafa 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -7586,7 +7586,6 @@ next:
return ret;
clear_bit(BTRFS_FS_LOG_RECOVERING, &fs_info->flags);
- btrfs_put_root(log_root_tree);
return 0;
error: