aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/tree-log.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2020-07-07 18:38:05 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-14 16:56:09 +0200
commiteefebcda89a8d865f117449d387953f1f715d421 (patch)
treece0cf3ef78d18749c6c45a1c8d0910f512081853 /fs/btrfs/tree-log.c
parentaec3a574c632e06b06d5f6fd731ddf57997372df (diff)
downloadkernel_replicant_linux-eefebcda89a8d865f117449d387953f1f715d421.tar.gz
kernel_replicant_linux-eefebcda89a8d865f117449d387953f1f715d421.tar.bz2
kernel_replicant_linux-eefebcda89a8d865f117449d387953f1f715d421.zip
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>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r--fs/btrfs/tree-log.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index 300951088a11..4b913de2f24f 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -6348,6 +6348,7 @@ next:
error:
if (wc.trans)
btrfs_end_transaction(wc.trans);
+ clear_bit(BTRFS_FS_LOG_RECOVERING, &fs_info->flags);
btrfs_free_path(path);
return ret;
}