diff mbox series

[-next] md: don't flush sync_work in md_write_start()

Message ID 20240801124746.242558-1-yukuai1@huaweicloud.com (mailing list archive)
State Accepted
Headers show
Series [-next] md: don't flush sync_work in md_write_start() | expand

Checks

Context Check Description
mdraidci/vmtest-md-6_11-PR success PR summary
mdraidci/vmtest-md-6_11-VM_Test-0 success Logs for build-kernel

Commit Message

Yu Kuai Aug. 1, 2024, 12:47 p.m. UTC
From: Yu Kuai <yukuai3@huawei.com>

Because flush sync_work may trigger mddev_suspend() if there are spares,
and this should never be done in IO path because mddev_suspend() is used
to wait for IO.

This problem is found by code review.

Fixes: bc08041b32ab ("md: suspend array in md_start_sync() if array need reconfiguration")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 drivers/md/md.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Song Liu Aug. 27, 2024, 4:58 p.m. UTC | #1
On Thu, Aug 1, 2024 at 5:51 AM Yu Kuai <yukuai1@huaweicloud.com> wrote:
>
> From: Yu Kuai <yukuai3@huawei.com>
>
> Because flush sync_work may trigger mddev_suspend() if there are spares,
> and this should never be done in IO path because mddev_suspend() is used
> to wait for IO.
>
> This problem is found by code review.
>
> Fixes: bc08041b32ab ("md: suspend array in md_start_sync() if array need reconfiguration")
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>

Applied to md-6.12. Thanks!

Song
diff mbox series

Patch

diff --git a/drivers/md/md.c b/drivers/md/md.c
index d3a837506a36..23cc77d51676 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -8668,7 +8668,6 @@  void md_write_start(struct mddev *mddev, struct bio *bi)
 	BUG_ON(mddev->ro == MD_RDONLY);
 	if (mddev->ro == MD_AUTO_READ) {
 		/* need to switch to read/write */
-		flush_work(&mddev->sync_work);
 		mddev->ro = MD_RDWR;
 		set_bit(MD_RECOVERY_NEEDED, &mddev->recovery);
 		md_wakeup_thread(mddev->thread);