summaryrefslogtreecommitdiff
path: root/drivers/md/dm-writecache.c
diff options
context:
space:
mode:
authorMikulas Patocka <mpatocka@redhat.com>2021-05-26 22:49:03 +0300
committerMike Snitzer <snitzer@redhat.com>2021-06-04 19:07:27 +0300
commitaf4f6cabcc5a2449e6b7663d45227bfcb6b725ec (patch)
tree5034858acd1b090e89c10ca3879d10b397e41290 /drivers/md/dm-writecache.c
parentee50cc19d80e9b9a8283d1fb517a778faf2f6899 (diff)
downloadlinux-af4f6cabcc5a2449e6b7663d45227bfcb6b725ec.tar.xz
dm writecache: interrupt writeback if suspended
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>
Diffstat (limited to 'drivers/md/dm-writecache.c')
-rw-r--r--drivers/md/dm-writecache.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c
index a44007297e63..ea9f0d8fff1d 100644
--- a/drivers/md/dm-writecache.c
+++ b/drivers/md/dm-writecache.c
@@ -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;
}