aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorJoe Thornber <ejt@redhat.com>2014-11-27 07:26:46 -0500
committerMike Snitzer <snitzer@redhat.com>2014-12-01 11:30:12 -0500
commit1e32134a5a404e80bfb47fad8a94e9bbfcbdacc5 (patch)
tree1a0b15c7664ec260ba26bbe6bb2e1ac4ce9c4a52 /drivers/md
parentf29a3147e251d7ae20d3194ff67f109d71e501b4 (diff)
dm cache: dirty flag was mistakenly being cleared when promoting via overwrite
If the incoming bio is a WRITE and completely covers a block then we don't bother to do any copying for a promotion operation. Once this is done the cache block and origin block will be different, so we need to set it to 'dirty'. Signed-off-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-cache-target.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/md/dm-cache-target.c b/drivers/md/dm-cache-target.c
index ef842feda101..1a090de0c4b8 100644
--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -988,10 +988,14 @@ static void migration_success_post_commit(struct dm_cache_migration *mg)
988 } 988 }
989 989
990 } else { 990 } else {
991 clear_dirty(cache, mg->new_oblock, mg->cblock); 991 if (mg->requeue_holder) {
992 if (mg->requeue_holder) 992 clear_dirty(cache, mg->new_oblock, mg->cblock);
993 cell_defer(cache, mg->new_ocell, true); 993 cell_defer(cache, mg->new_ocell, true);
994 else { 994 } else {
995 /*
996 * The block was promoted via an overwrite, so it's dirty.
997 */
998 set_dirty(cache, mg->new_oblock, mg->cblock);
995 bio_endio(mg->new_ocell->holder, 0); 999 bio_endio(mg->new_ocell->holder, 0);
996 cell_defer(cache, mg->new_ocell, false); 1000 cell_defer(cache, mg->new_ocell, false);
997 } 1001 }