Blob Blame History Raw
From: Pingfan Liu <piliu@redhat.com>
Date: Wed, 15 Feb 2023 19:23:40 +0800
Subject: [PATCH] dm: add cond_resched() to dm_wq_work()
References: bsc#1012628
Patch-mainline: 6.2.3
Git-commit: 0ca44fcef241768fd25ee763b3d203b9852f269b

commit 0ca44fcef241768fd25ee763b3d203b9852f269b upstream.

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: stable@vger.kernel.org
Signed-off-by: Pingfan Liu <piliu@redhat.com>
Acked-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 drivers/md/dm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index edf7af98..3aea215a 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -2565,6 +2565,7 @@ static void dm_wq_work(struct work_struct *work)
 			break;
 
 		submit_bio_noacct(bio);
+		cond_resched();
 	}
 }
 
-- 
2.35.3