From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:38359 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752367AbbJQThk (ORCPT ); Sat, 17 Oct 2015 15:37:40 -0400 Subject: Patch "dm thin: disable discard support for thin devices if pool's is disabled" has been added to the 4.2-stable tree To: snitzer@redhat.com, gregkh@linuxfoundation.org Cc: , From: Date: Sat, 17 Oct 2015 12:37:39 -0700 Message-ID: <1445110659225246@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: 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 know about it. >>From 216076705d6ac291d42e0f8dd85e6a0da98c0fa3 Mon Sep 17 00:00:00 2001 From: Mike Snitzer 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 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 Signed-off-by: Greg Kroah-Hartman --- 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