Commit 23c115eb authored by Joe Thornber's avatar Joe Thornber Committed by Luis Henriques

dm cache: only use overwrite optimisation for promotion when in writeback mode

commit f29a3147 upstream.

Overwrite causes the cache block and origin blocks to diverge, which
is only allowed in writeback mode.
Signed-off-by: default avatarJoe Thornber <ejt@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 4fc2985b
...@@ -1043,7 +1043,8 @@ static void issue_copy(struct dm_cache_migration *mg) ...@@ -1043,7 +1043,8 @@ static void issue_copy(struct dm_cache_migration *mg)
avoid = is_discarded_oblock(cache, mg->new_oblock); 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); issue_overwrite(mg, bio);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment