Skip to content

Commit fa1944b

Browse files
XiaoNi87liu-song-6
authored andcommitted
md/raid5: Wait sync io to finish before changing group cnt
One customer reports a bug: raid5 is hung when changing thread cnt while resync is running. The stripes are all in conf->handle_list and new threads can't handle them. Commit b39f35e ("md: don't quiesce in mddev_suspend()") removes pers->quiesce from mddev_suspend/resume. Before this patch, mddev_suspend needs to wait for all ios including sync io to finish. Now it's used to only wait normal io. Fix this by calling raid5_quiesce from raid5_store_group_thread_cnt directly to wait all sync requests to finish before changing the group cnt. Fixes: b39f35e ("md: don't quiesce in mddev_suspend()") Cc: [email protected] Signed-off-by: Xiao Ni <[email protected]> Reviewed-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
1 parent 4122fef commit fa1944b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/md/raid5.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7176,6 +7176,8 @@ raid5_store_group_thread_cnt(struct mddev *mddev, const char *page, size_t len)
71767176
err = mddev_suspend_and_lock(mddev);
71777177
if (err)
71787178
return err;
7179+
raid5_quiesce(mddev, true);
7180+
71797181
conf = mddev->private;
71807182
if (!conf)
71817183
err = -ENODEV;
@@ -7197,6 +7199,8 @@ raid5_store_group_thread_cnt(struct mddev *mddev, const char *page, size_t len)
71977199
kfree(old_groups);
71987200
}
71997201
}
7202+
7203+
raid5_quiesce(mddev, false);
72007204
mddev_unlock_and_resume(mddev);
72017205

72027206
return err ?: len;

0 commit comments

Comments
 (0)