Commit 7347b5ff authored by Marco Sanvido's avatar Marco Sanvido Committed by Nicholas Bellinger

target: Fix iblock se_dev_attrib.unmap_granularity

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: default avatarRoland Dreier <roland@purestorage.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 735703ca
...@@ -181,7 +181,7 @@ static struct se_device *iblock_create_virtdevice( ...@@ -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.max_unmap_block_desc_count = 1;
dev->se_sub_dev->se_dev_attrib.unmap_granularity = 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 = dev->se_sub_dev->se_dev_attrib.unmap_granularity_alignment =
q->limits.discard_alignment; q->limits.discard_alignment;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment