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>
This commit is contained in:
Mikulas Patocka 2021-05-26 15:49:03 -04:00 committed by Mike Snitzer
parent ee50cc19d8
commit af4f6cabcc
1 changed files with 3 additions and 2 deletions

View 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;
}