]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: always drop log root tree reference in btrfs_replay_log()
authorFilipe Manana <fdmanana@suse.com>
Wed, 27 Aug 2025 11:10:28 +0000 (12:10 +0100)
committerDavid Sterba <dsterba@suse.com>
Tue, 23 Sep 2025 06:49:18 +0000 (08:49 +0200)
commit2f5b8095ea47b142c56c09755a8b1e14145a2d30
tree98688fc65a247bcbd4f5fe218eba27071e4531cb
parent4b7699f406225ce13afc6cbb320d4b84e9c8fe0f
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>
fs/btrfs/disk-io.c
fs/btrfs/tree-log.c