]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
md/raid5: Wait sync io to finish before changing group cnt
authorXiao Ni <xni@redhat.com>
Wed, 6 Nov 2024 09:51:24 +0000 (17:51 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 9 Dec 2024 09:40:56 +0000 (10:40 +0100)
commitbe19e6e4339d1579d5f2fae8ce4facf9521dbbfc
tree97bbce52ede9f7ca37e0f36a68a5815010d7d17c
parent596f7faa60b25a44314865b78ffb4fb75c941b7a
md/raid5: Wait sync io to finish before changing group cnt

commit fa1944bbe6220eb929e2c02e5e8706b908565711 upstream.

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 b39f35ebe86d ("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: b39f35ebe86d ("md: don't quiesce in mddev_suspend()")
Cc: stable@vger.kernel.org
Signed-off-by: Xiao Ni <xni@redhat.com>
Reviewed-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20241106095124.74577-1-xni@redhat.com
Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/raid5.c