Skip to contentSkip to conversation

Btrfs: stop all workers after we free block groups

PATCH In review Josef Bacik 2 participants 2 messages Oct 16, 2013 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Btrfs: stop all workers after we free block groups

Stefan was hitting a panic in the async worker stuff because we had outstanding read bios while we were stopping the worker threads. You could reproduce this easily if you mount -o nospace_cache and ran generic/273. This is because the caching thread stuff is still going and we were stopping all the worker threads. We need to stop the workers after this work is done, and the free block groups code will wait for all the caching threads to stop first so we don't run into this problem. With this patch we no longer panic. Thanks,

---
 fs/btrfs/disk-io.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/disk-io.c +2 -2
index 419968e..b0ea9f4 100644
@@ -3637,12 +3637,12 @@ int close_ctree(struct btrfs_root *root)
 		       percpu_counter_sum(&fs_info->delalloc_bytes));
 	}
 
-	btrfs_stop_all_workers(fs_info);
-
 	del_fs_roots(fs_info);
 
 	btrfs_free_block_groups(fs_info);
 
+	btrfs_stop_all_workers(fs_info);
+
 	free_root_pointers(fs_info, 1);
 
 	iput(fs_info->btree_inode);
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 4 lines · Josef Bacik

Stefan was hitting a panic in the async worker stuff because we had outstanding read bios while we were stopping the worker threads.

 fs/btrfs/disk-io.c | 4 ++--

Seems like a nice candidate for stable@, no?

- z