Thread (30 messages) 30 messages, 4 authors, 2021-05-26

Re: [PATCH 3/9] btrfs: clear log tree recovering status if starting transaction fails

From: Anand Jain <hidden>
Date: 2021-05-26 06:58:10

On 26/05/2021 01:08, David Sterba wrote:
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")
Signed-off-by: David Sterba <dsterba@suse.com>
  Reviewed-by: Anand Jain [off-list ref]

Thanks.
quoted hunk ↗ jump to hunk
---
  fs/btrfs/tree-log.c | 1 +
  1 file changed, 1 insertion(+)
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c
index c6d4aeede159..5c1d58706fa9 100644
--- a/fs/btrfs/tree-log.c
+++ b/fs/btrfs/tree-log.c
@@ -6372,6 +6372,7 @@ int btrfs_recover_log_trees(struct btrfs_root *log_root_tree)
  error:
  	if (wc.trans)
  		btrfs_end_transaction(wc.trans);
+	clear_bit(BTRFS_FS_LOG_RECOVERING, &fs_info->flags);
  	btrfs_free_path(path);
  	return ret;
  }
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help