]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
dm: add cond_resched() to dm_wq_work()
authorPingfan Liu <piliu@redhat.com>
Wed, 15 Feb 2023 11:23:40 +0000 (19:23 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:34:21 +0000 (09:34 +0100)
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>
drivers/md/dm.c

index c9d034c952a4edf5f05f443eafe527b14abc6a5b..212441671554c762e4fb61536528fe328b5b290c 100644 (file)
@@ -2578,6 +2578,7 @@ static void dm_wq_work(struct work_struct *work)
                        break;
 
                submit_bio_noacct(bio);
+               cond_resched();
        }
 }