Linux kernel -stable discussions
 help / color / mirror / Atom feed
* Patch "dm thin: disable discard support for thin devices if pool's is disabled" has been added to the 4.2-stable tree
@ 2015-10-17 19:37 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2015-10-17 19:37 UTC (permalink / raw)
  To: snitzer, gregkh; +Cc: stable, stable-commits


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

    dm thin: disable discard support for thin devices if pool's is disabled

to the 4.2-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-disable-discard-support-for-thin-devices-if-pool-s-is-disabled.patch
and it can be found in the queue-4.2 subdirectory.

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


>From 216076705d6ac291d42e0f8dd85e6a0da98c0fa3 Mon Sep 17 00:00:00 2001
From: Mike Snitzer <snitzer@redhat.com>
Date: Tue, 8 Sep 2015 08:56:13 -0400
Subject: dm thin: disable discard support for thin devices if pool's is disabled

From: Mike Snitzer <snitzer@redhat.com>

commit 216076705d6ac291d42e0f8dd85e6a0da98c0fa3 upstream.

If the pool is configured with 'ignore_discard' its discard support is
disabled.  The pool's thin devices should also have queue_limits that
reflect discards are disabled.

Fixes: 34fbcf62 ("dm thin: range discard support")
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

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

--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -4333,6 +4333,10 @@ static void thin_io_hints(struct dm_targ
 {
 	struct thin_c *tc = ti->private;
 	struct pool *pool = tc->pool;
+	struct queue_limits *pool_limits = dm_get_queue_limits(pool->pool_md);
+
+	if (!pool_limits->discard_granularity)
+		return; /* pool's discard support is disabled */
 
 	limits->discard_granularity = pool->sectors_per_block << SECTOR_SHIFT;
 	limits->max_discard_sectors = 2048 * 1024 * 16; /* 16G */


Patches currently in stable-queue which might be from snitzer@redhat.com are

queue-4.2/dm-crypt-constrain-crypt-device-s-max_segment_size-to-page_size.patch
queue-4.2/dm-thin-disable-discard-support-for-thin-devices-if-pool-s-is-disabled.patch
queue-4.2/dm-raid-fix-round-up-of-default-region-size.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-17 19:37 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-17 19:37 Patch "dm thin: disable discard support for thin devices if pool's is disabled" has been added to the 4.2-stable tree gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox