]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
dm writecache: skip writecache_wait when using pmem mode
authorHuaisheng Ye <yehs1@lenovo.com>
Fri, 12 Jun 2020 15:55:44 +0000 (23:55 +0800)
committerMike Snitzer <snitzer@redhat.com>
Wed, 17 Jun 2020 16:25:42 +0000 (12:25 -0400)
The array bio_in_progress is only used with ssd mode. So skip
writecache_wait_for_ios in writecache_discard when pmem mode.

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

index ddff5527dbdf3869b244c49d37cd37565836cbec..6b28990b1d84a0f2fe599d1315cf56b1bca2be50 100644 (file)
@@ -849,8 +849,10 @@ static void writecache_discard(struct dm_writecache *wc, sector_t start, sector_
 
                if (likely(!e->write_in_progress)) {
                        if (!discarded_something) {
-                               writecache_wait_for_ios(wc, READ);
-                               writecache_wait_for_ios(wc, WRITE);
+                               if (!WC_MODE_PMEM(wc)) {
+                                       writecache_wait_for_ios(wc, READ);
+                                       writecache_wait_for_ios(wc, WRITE);
+                               }
                                discarded_something = true;
                        }
                        if (!writecache_entry_is_committed(wc, e))