Discussion:
Patch "Btrfs: don't do async reclaim during log replay" has been added to the 3.16-stable tree
g***@linuxfoundation.org
2014-10-19 23:12:00 UTC
Permalink
This is a note to let you know that I've just added the patch titled

Btrfs: don't do async reclaim during log replay

to the 3.16-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
btrfs-don-t-do-async-reclaim-during-log-replay.patch
and it can be found in the queue-3.16 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
From f6acfd50110b335c7af636cf1fc8e55319cae5fc Mon Sep 17 00:00:00 2001
From: Josef Bacik <***@fb.com>
Date: Thu, 18 Sep 2014 11:27:17 -0400
Subject: Btrfs: don't do async reclaim during log replay

From: Josef Bacik <***@fb.com>

commit f6acfd50110b335c7af636cf1fc8e55319cae5fc upstream.

Trying to reproduce a log enospc bug I hit a panic in the async reclaim code
during log replay. This is because we use fs_info->fs_root as our root for
shrinking and such. Technically we can use whatever root we want, but let's
just not allow async reclaim while we're doing log replay. Thanks,

Signed-off-by: Josef Bacik <***@fb.com>
Signed-off-by: Chris Mason <***@fb.com>
Signed-off-by: Greg Kroah-Hartman <***@linuxfoundation.org>

---
fs/btrfs/extent-tree.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -4508,7 +4508,13 @@ again:
space_info->flush = 1;
} else if (!ret && space_info->flags & BTRFS_BLOCK_GROUP_METADATA) {
used += orig_bytes;
- if (need_do_async_reclaim(space_info, root->fs_info, used) &&
+ /*
+ * We will do the space reservation dance during log replay,
+ * which means we won't have fs_info->fs_root set, so don't do
+ * the async reclaim as we will panic.
+ */
+ if (!root->fs_info->log_root_recovering &&
+ need_do_async_reclaim(space_info, root->fs_info, used) &&
!work_busy(&root->fs_info->async_reclaim_work))
queue_work(system_unbound_wq,
&root->fs_info->async_reclaim_work);


Patches currently in stable-queue which might be from ***@fb.com are

queue-3.16/btrfs-fix-build_backref_tree-issue-with-multiple-shared-blocks.patch
queue-3.16/btrfs-try-not-to-enospc-on-log-replay.patch
queue-3.16/btrfs-don-t-do-async-reclaim-during-log-replay.patch
queue-3.16/btrfs-cleanup-error-handling-in-build_backref_tree.patch
Loading...