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

    dm thin: update discard_granularity to reflect the thin-pool blocksize

to the 3.15-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-thin-update-discard_granularity-to-reflect-the-thin-pool-blocksize.patch
and it can be found in the queue-3.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 09869de57ed2728ae3c619803932a86cb0e2c4f8 Mon Sep 17 00:00:00 2001
From: Lukas Czerner <[email protected]>
Date: Wed, 11 Jun 2014 12:28:43 -0400
Subject: dm thin: update discard_granularity to reflect the thin-pool blocksize

From: Lukas Czerner <[email protected]>

commit 09869de57ed2728ae3c619803932a86cb0e2c4f8 upstream.

DM thinp already checks whether the discard_granularity of the data
device is a factor of the thin-pool block size.  But when using the
dm-thin-pool's discard passdown support, DM thinp was not selecting the
max of the underlying data device's discard_granularity and the
thin-pool's block size.

Update set_discard_limits() to set discard_granularity to the max of
these values.  This enables blkdev_issue_discard() to properly align the
discards that are sent to the DM thin device on a full block boundary.
As such each discard will now cover an entire DM thin-pool block and the
block will be reclaimed.

Reported-by: Zdenek Kabelac <[email protected]>
Signed-off-by: Lukas Czerner <[email protected]>
Signed-off-by: Mike Snitzer <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/md/dm-thin.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -3068,7 +3068,8 @@ static void set_discard_limits(struct po
         */
        if (pt->adjusted_pf.discard_passdown) {
                data_limits = &bdev_get_queue(pt->data_dev->bdev)->limits;
-               limits->discard_granularity = data_limits->discard_granularity;
+               limits->discard_granularity = 
max(data_limits->discard_granularity,
+                                                 pool->sectors_per_block << 
SECTOR_SHIFT);
        } else
                limits->discard_granularity = pool->sectors_per_block << 
SECTOR_SHIFT;
 }


Patches currently in stable-queue which might be from [email protected] are

queue-3.15/dm-thin-update-discard_granularity-to-reflect-the-thin-pool-blocksize.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to