summary refs log tree commit diff
path: root/drivers/md
diff options
context:
space:
mode:
authorPingfan Liu <piliu@redhat.com>2023-02-15 19:23:40 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-10 09:34:21 +0100
commit7f093695b49a0e46d2f1ad0c641dd04f8d20acd9 (patch)
tree48a429de50c55cef2866d4b39cc2bbba0f62dba4 /drivers/md
parentbc0734f689f817821f2a86ada1ee51271b462e06 (diff)
downloadlinux-7f093695b49a0e46d2f1ad0c641dd04f8d20acd9.tar.gz
dm: add cond_resched() to dm_wq_work()
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>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index c9d034c952a4..212441671554 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -2578,6 +2578,7 @@ static void dm_wq_work(struct work_struct *work)
 			break;
 
 		submit_bio_noacct(bio);
+		cond_resched();
 	}
 }