On Wed, Jun 11 2014 at 8:32am -0400, Lukas Czerner <lczerner@xxxxxxxxxx> wrote: > Currently if the underlying device is discard capable and the > discard_passdown is enabled, the discard_granularity will be inherited > from that device. > > This will pose a problem in the case that the device discard_granularity > is smaller than thin volume chunk size, because in that case discard > requests will not be chunk size aligned so it will be ignored by > dm-thin. > > Fix this by setting thin volume discard granularity to the bigger of the > two max(device discard_granularity, thin volume chunk size). Strictly > speaking it is not necessary to get the bigger of the two, because > the thin volume chunk size will always be >= device discard_granularity. > However I believe that the reason for this is only because dm-thin can > not handle discard requests bigger than chunk size which is hopefully > going to change soon. This way it is future proof. > > RHBZ: 1106856 > > Reported-by: Zdenek Kabelac <zkabelac@xxxxxxxxxxxxxxxxx> > Signed-off-by: Lukas Czerner <lczerner@xxxxxxxxxx> Hi Lukas, I missed this submission on dm-devel until now. But I had already picked this patch up earlier from the BZ, see the patch I staged in linux-next here: https://git.kernel.org/cgit/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=for-next&id=09869de57ed2728ae3c619803932a86cb0e2c4f8 -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel