From: Pingfan Liu <[email protected]>

Otherwise the while() loop in dm_wq_work() can result in a "dead
loop" on systems that have preemption disabled. This is particularly
problematic on single cpu systems.

Cc: [email protected]
Signed-off-by: Pingfan Liu <[email protected]>
Acked-by: Ming Lei <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
---
 drivers/md/dm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 90b64bfc63b0..15b91959e433 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -2570,6 +2570,7 @@ static void dm_wq_work(struct work_struct *work)
                        break;
 
                submit_bio_noacct(bio);
+               cond_resched();
        }
 }
 
-- 
2.37.0 (Apple Git-136)

--
dm-devel mailing list
[email protected]
https://listman.redhat.com/mailman/listinfo/dm-devel

Reply via email to