Re: [PATCH] target: Fix iblock se_dev_attrib.unmap_granularity

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

 



On Fri, 2012-01-20 at 15:49 -0800, Roland Dreier wrote:
> From: Marco Sanvido <marco@xxxxxxxxxxxxxxx>
> 
> The block layer keeps q->limits.discard_granularity in bytes, but iblock
> (and the SCSI Block Limits VPD page) keep unmap_granularity in blocks.
> Report the correct value when exporting block devices by dividing to
> convert bytes to blocks.
> 
> Signed-off-by: Roland Dreier <roland@xxxxxxxxxxxxxxx>
> ---
>  drivers/target/target_core_iblock.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c
> index cc8e6b5..8950206 100644
> --- a/drivers/target/target_core_iblock.c
> +++ b/drivers/target/target_core_iblock.c
> @@ -181,7 +181,7 @@ static struct se_device *iblock_create_virtdevice(
>  		 */
>  		dev->se_sub_dev->se_dev_attrib.max_unmap_block_desc_count = 1;
>  		dev->se_sub_dev->se_dev_attrib.unmap_granularity =
> -				q->limits.discard_granularity;
> +				q->limits.discard_granularity >> 9;
>  		dev->se_sub_dev->se_dev_attrib.unmap_granularity_alignment =
>  				q->limits.discard_alignment;
>  

Applied to lio-core and will queue for 3.3-rc-fixes.

Thanks Roland!

--nab

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux