Patch "dm cache: dirty flag was mistakenly being cleared when promoting via overwrite" has been added to the 3.18-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    dm cache: dirty flag was mistakenly being cleared when promoting via overwrite

to the 3.18-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     dm-cache-dirty-flag-was-mistakenly-being-cleared-when-promoting-via-overwrite.patch
and it can be found in the queue-3.18 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 1e32134a5a404e80bfb47fad8a94e9bbfcbdacc5 Mon Sep 17 00:00:00 2001
From: Joe Thornber <ejt@xxxxxxxxxx>
Date: Thu, 27 Nov 2014 12:26:46 +0000
Subject: dm cache: dirty flag was mistakenly being cleared when promoting via overwrite

From: Joe Thornber <ejt@xxxxxxxxxx>

commit 1e32134a5a404e80bfb47fad8a94e9bbfcbdacc5 upstream.

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@xxxxxxxxxx>
Signed-off-by: Mike Snitzer <snitzer@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 drivers/md/dm-cache-target.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

--- a/drivers/md/dm-cache-target.c
+++ b/drivers/md/dm-cache-target.c
@@ -951,10 +951,14 @@ static void migration_success_post_commi
 		}
 
 	} else {
-		clear_dirty(cache, mg->new_oblock, mg->cblock);
-		if (mg->requeue_holder)
+		if (mg->requeue_holder) {
+			clear_dirty(cache, mg->new_oblock, mg->cblock);
 			cell_defer(cache, mg->new_ocell, true);
-		else {
+		} else {
+			/*
+			 * The block was promoted via an overwrite, so it's dirty.
+			 */
+			set_dirty(cache, mg->new_oblock, mg->cblock);
 			bio_endio(mg->new_ocell->holder, 0);
 			cell_defer(cache, mg->new_ocell, false);
 		}


Patches currently in stable-queue which might be from ejt@xxxxxxxxxx are

queue-3.18/dm-space-map-metadata-fix-sm_bootstrap_get_nr_blocks.patch
queue-3.18/dm-thin-fix-missing-out-of-data-space-to-write-mode-transition-if-blocks-are-released.patch
queue-3.18/dm-cache-fix-spurious-cell_defer-when-dealing-with-partial-block-at-end-of-device.patch
queue-3.18/dm-thin-fix-inability-to-discard-blocks-when-in-out-of-data-space-mode.patch
queue-3.18/dm-cache-only-use-overwrite-optimisation-for-promotion-when-in-writeback-mode.patch
queue-3.18/dm-cache-dirty-flag-was-mistakenly-being-cleared-when-promoting-via-overwrite.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]