summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2014-11-27 12:21:08 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-01-08 10:30:18 -0800
commit4df99e3c893acb4d7325c33317e18573b4283d07 (patch)
treec1e73ad72890e0ecc1709a75980d02a55386cc95 /drivers/md
parent6425e7b0c86689e8788fdc892c503d1c2ba40004 (diff)
downloadlwn-4df99e3c893acb4d7325c33317e18573b4283d07.tar.gz
lwn-4df99e3c893acb4d7325c33317e18573b4283d07.zip
dm cache: only use overwrite optimisation for promotion when in writeback mode
commit f29a3147e251d7ae20d3194ff67f109d71e501b4 upstream. Overwrite causes the cache block and origin blocks to diverge, which is only allowed in writeback mode. Signed-off-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-cache-target.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c
index 7130505c2425..6f7086355691 100644
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -1070,7 +1070,8 @@ static void issue_copy(struct dm_cache_migration *mg)
avoid = is_discarded_oblock(cache, mg->new_oblock);
- if (!avoid && bio_writes_complete_block(cache, bio)) {
+ if (writeback_mode(&cache->features) &&
+ !avoid && bio_writes_complete_block(cache, bio)) {
issue_overwrite(mg, bio);
return;
}