aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/scrub.c
diff options
context:
space:
mode:
authorArne Jansen <sensille@gmx.net>2011-06-10 06:07:07 -0400
committerArne Jansen <sensille@gmx.net>2011-06-10 06:14:13 -0400
commit632dd772fcbde2ba37c0e8983bd38ef4a1eac906 (patch)
tree6181590ab930fb20c3efb3f44f88901089b9618b /fs/btrfs/scrub.c
parent8c51032f978bac5bec5dae0c5de4f85db97c1cc9 (diff)
btrfs: reinitialize scrub workers
Scrub starts the workers each time a scrub starts and stops them after it finished. This patch adds an initialization for the workers before each start, otherwise the workers behave strangely. Signed-off-by: Arne Jansen <sensille@gmx.net>
Diffstat (limited to 'fs/btrfs/scrub.c')
-rw-r--r--fs/btrfs/scrub.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index d5a4108cedaf..92cac19388ed 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -1166,8 +1166,12 @@ static noinline_for_stack int scrub_workers_get(struct btrfs_root *root)
1166 struct btrfs_fs_info *fs_info = root->fs_info; 1166 struct btrfs_fs_info *fs_info = root->fs_info;
1167 1167
1168 mutex_lock(&fs_info->scrub_lock); 1168 mutex_lock(&fs_info->scrub_lock);
1169 if (fs_info->scrub_workers_refcnt == 0) 1169 if (fs_info->scrub_workers_refcnt == 0) {
1170 btrfs_init_workers(&fs_info->scrub_workers, "scrub",
1171 fs_info->thread_pool_size, &fs_info->generic_worker);
1172 fs_info->scrub_workers.idle_thresh = 4;
1170 btrfs_start_workers(&fs_info->scrub_workers, 1); 1173 btrfs_start_workers(&fs_info->scrub_workers, 1);
1174 }
1171 ++fs_info->scrub_workers_refcnt; 1175 ++fs_info->scrub_workers_refcnt;
1172 mutex_unlock(&fs_info->scrub_lock); 1176 mutex_unlock(&fs_info->scrub_lock);
1173 1177