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>
Fri, 4 Jun 2021 16:07:27 +0000 (12:07 -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 a440072..ea9f0d8 100644 (file)
@@ -1844,8 +1844,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;
                }