]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
btrfs: clear log tree recovering status if starting transaction fails
authorDavid Sterba <dsterba@suse.com>
Tue, 7 Jul 2020 16:38:05 +0000 (18:38 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jul 2021 14:59:37 +0000 (16:59 +0200)
commit5874f6919410c284d0e695acf5a638f0c17b528f
treed2adc63f57090446fc0df30e66f80ac7a4e4442d
parentf141c67ee5030a367519265d9f04265641511382
btrfs: clear log tree recovering status if starting transaction fails

[ Upstream commit 1aeb6b563aea18cd55c73cf666d1d3245a00f08c ]

When a log recovery is in progress, lots of operations have to take that
into account, so we keep this status per tree during the operation. Long
time ago error handling revamp patch 79787eaab461 ("btrfs: replace many
BUG_ONs with proper error handling") removed clearing of the status in
an error branch. Add it back as was intended in e02119d5a7b4 ("Btrfs:
Add a write ahead tree log to optimize synchronous operations").

There are probably no visible effects, log replay is done only during
mount and if it fails all structures are cleared so the stale status
won't be kept.

Fixes: 79787eaab461 ("btrfs: replace many BUG_ONs with proper error handling")
Reviewed-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/btrfs/tree-log.c