summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorHuaisheng Ye <yehs1@lenovo.com>2020-06-12 17:55:44 +0200
committerMike Snitzer <snitzer@redhat.com>2020-06-17 18:25:42 +0200
commita143e172b66d992092eb6cf984f79d6989b684d6 (patch)
tree4505908291c56ec03fd1e10b3058a872b46eb52c /drivers/md
parentdm writecache: correct uncommitted_block when discarding uncommitted entry (diff)
downloadlinux-a143e172b66d992092eb6cf984f79d6989b684d6.tar.xz
linux-a143e172b66d992092eb6cf984f79d6989b684d6.zip
dm writecache: skip writecache_wait when using pmem mode
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>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-writecache.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c
index ddff5527dbdf..6b28990b1d84 100644
--- a/drivers/md/dm-writecache.c
+++ b/drivers/md/dm-writecache.c
@@ -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))