]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
md: fix missing flush of sync_work
authorYu Kuai <yukuai3@huawei.com>
Tue, 5 Dec 2023 09:42:13 +0000 (17:42 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Feb 2025 12:10:53 +0000 (04:10 -0800)
commit4b79bee3e3c0b66b18fbb6187d68927366c8f3b5
treed4c6fb0414e06f4181a46ceff7324cb5c39c7f19
parentd6fe973c8873c998734a050f366b28facc03d32a
md: fix missing flush of sync_work

commit f2d87a759f6841a132e845e2fafdad37385ddd30 upstream.

Commit ac619781967b ("md: use separate work_struct for md_start_sync()")
use a new sync_work to replace del_work, however, stop_sync_thread() and
__md_stop_writes() was trying to wait for sync_thread to be done, hence
they should switch to use sync_work as well.

Noted that md_start_sync() from sync_work will grab 'reconfig_mutex',
hence other contex can't held the same lock to flush work, and this will
be fixed in later patches.

Fixes: ac619781967b ("md: use separate work_struct for md_start_sync()")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Acked-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Song Liu <song@kernel.org>
Link: https://lore.kernel.org/r/20231205094215.1824240-2-yukuai1@huaweicloud.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/md/md.c