summaryrefslogtreecommitdiff
path: root/drivers
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:00:48 -0800
commit624f917e5a7123e794486df12ed779f50b0e2706 (patch)
tree7d6c7706ec53b98ef8e733adc745604a20563e9a /drivers
parenta6e37a9dcf822402ad1f9afc5a7bca0c98a486a1 (diff)
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')
-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 2331543005b2..3e573a7bbf10 100644
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -1060,7 +1060,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;
}