]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
dm writecache: interrupt writeback if suspended
authorMikulas Patocka <mpatocka@redhat.com>
Wed, 26 May 2021 19:49:03 +0000 (15:49 -0400)
committerMike Snitzer <snitzer@redhat.com>
Tue, 1 Jun 2021 21:57:46 +0000 (17:57 -0400)
If the DM device is suspended, interrupt the writeback sequence so
that there is no excessive suspend delay.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
drivers/md/dm-writecache.c

index 4a7891be2f0ac060bf20fc2c09ba2c611c1fbe40..703dba6f70223ae891c488cde2c1ce34e0a3c428 100644 (file)
@@ -1846,8 +1846,9 @@ restart:
 
                n_walked++;
                if (unlikely(n_walked > WRITEBACK_LATENCY) &&
-                   likely(!wc->writeback_all) && likely(!dm_suspended(wc->ti))) {
-                       queue_work(wc->writeback_wq, &wc->writeback_work);
+                   likely(!wc->writeback_all)) {
+                       if (likely(!dm_suspended(wc->ti)))
+                               queue_work(wc->writeback_wq, &wc->writeback_work);
                        break;
                }