summary refs log tree commit diff
path: root/drivers/md
diff options
context:
space:
mode:
authorMike Snitzer <snitzer@kernel.org>2023-02-16 12:10:05 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-10 09:34:21 +0100
commit2b3c953226cbad48990a98cce02da236ea07662c (patch)
treed6635ec5a141cbd2bbf750f269cd707d64c2dfb0 /drivers/md
parent7f093695b49a0e46d2f1ad0c641dd04f8d20acd9 (diff)
downloadlinux-2b3c953226cbad48990a98cce02da236ea07662c.tar.gz
dm: add cond_resched() to dm_wq_requeue_work()
commit f77692d65d54665d81815349cc727baa85e8b71d upstream.

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

Fixes: 8b211aaccb915 ("dm: add two stage requeue mechanism")
Cc: stable@vger.kernel.org
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 212441671554..d727ed9cd623 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1020,6 +1020,7 @@ static void dm_wq_requeue_work(struct work_struct *work)
 		io->next = NULL;
 		__dm_io_complete(io, false);
 		io = next;
+		cond_resched();
 	}
 }