diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 6c724fde5fd8bf740487f5c1acd577f3cc081858..fea67727f807ca1a99c2b688519f1dc22bcc5331 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -5413,6 +5413,9 @@ raid5_store_group_thread_cnt(struct mddev *mddev, const char *page, size_t len) old_groups = conf->worker_groups; old_group_cnt = conf->worker_cnt_per_group; + if (old_groups) + flush_workqueue(raid5_wq); + conf->worker_groups = NULL; err = alloc_thread_groups(conf, new); if (err) {