diff options
author | Josef Bacik <jbacik@fb.com> | 2014-09-18 11:27:17 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-09-22 20:13:31 -0400 |
commit | f6acfd50110b335c7af636cf1fc8e55319cae5fc (patch) | |
tree | cfd2993ba149a853872ab7b50ffad9b7a0ed21e6 /fs | |
parent | 47ab2a6c689913db23ccae38349714edf8365e0a (diff) |
Btrfs: don't do async reclaim during log replay
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 <jbacik@fb.com>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/btrfs/extent-tree.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index 28a27d5f02d3..44d04979f071 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -4513,7 +4513,13 @@ again: | |||
4513 | space_info->flush = 1; | 4513 | space_info->flush = 1; |
4514 | } else if (!ret && space_info->flags & BTRFS_BLOCK_GROUP_METADATA) { | 4514 | } else if (!ret && space_info->flags & BTRFS_BLOCK_GROUP_METADATA) { |
4515 | used += orig_bytes; | 4515 | used += orig_bytes; |
4516 | if (need_do_async_reclaim(space_info, root->fs_info, used) && | 4516 | /* |
4517 | * We will do the space reservation dance during log replay, | ||
4518 | * which means we won't have fs_info->fs_root set, so don't do | ||
4519 | * the async reclaim as we will panic. | ||
4520 | */ | ||
4521 | if (!root->fs_info->log_root_recovering && | ||
4522 | need_do_async_reclaim(space_info, root->fs_info, used) && | ||
4517 | !work_busy(&root->fs_info->async_reclaim_work)) | 4523 | !work_busy(&root->fs_info->async_reclaim_work)) |
4518 | queue_work(system_unbound_wq, | 4524 | queue_work(system_unbound_wq, |
4519 | &root->fs_info->async_reclaim_work); | 4525 | &root->fs_info->async_reclaim_work); |