dm: add cond_resched() to dm_wq_requeue_work()
authorMike Snitzer <snitzer@kernel.org>
Thu, 16 Feb 2023 17:10:05 +0000 (12:10 -0500)
committerMike Snitzer <snitzer@kernel.org>
Thu, 16 Feb 2023 17:10:05 +0000 (12:10 -0500)
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>
drivers/md/dm.c

index 15b9195..adb002b 100644 (file)
@@ -1009,6 +1009,7 @@ static void dm_wq_requeue_work(struct work_struct *work)
                io->next = NULL;
                __dm_io_complete(io, false);
                io = next;
+               cond_resched();
        }
 }