mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-09-22 09:34:56 +02:00
btrfs: always drop log root tree reference in btrfs_replay_log()
[ Upstream commit 2f5b8095ea ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
3b838f39f4
commit
ef64d81fb7
+1
-1
@@ -2080,10 +2080,10 @@ static int btrfs_replay_log(struct btrfs_fs_info *fs_info,
|
||||
|
||||
/* returns with log_tree_root freed on success */
|
||||
ret = btrfs_recover_log_trees(log_tree_root);
|
||||
btrfs_put_root(log_tree_root);
|
||||
if (ret) {
|
||||
btrfs_handle_fs_error(fs_info, ret,
|
||||
"Failed to recover log tree");
|
||||
btrfs_put_root(log_tree_root);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -7422,7 +7422,6 @@ next:
|
||||
|
||||
log_root_tree->log_root = NULL;
|
||||
clear_bit(BTRFS_FS_LOG_RECOVERING, &fs_info->flags);
|
||||
btrfs_put_root(log_root_tree);
|
||||
|
||||
return 0;
|
||||
error:
|
||||
|
||||
Reference in New Issue
Block a user