Skip to content

Commit

Permalink
target: Fix iblock se_dev_attrib.unmap_granularity
Browse files Browse the repository at this point in the history
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@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
Marco Sanvido authored and Nicholas Bellinger committed Feb 7, 2012
1 parent 735703c commit 7347b5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/target/target_core_iblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 7347b5f

Please sign in to comment.