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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:34:21 +0000 (09:34 +0100)
commit2b3c953226cbad48990a98cce02da236ea07662c
treed6635ec5a141cbd2bbf750f269cd707d64c2dfb0
parent7f093695b49a0e46d2f1ad0c641dd04f8d20acd9
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>
drivers/md/dm.c