Commit 7347b5ff7090b2b399b7921a266255cd55bbd78f
Committed by
Nicholas Bellinger
1 parent
735703cac0
Exists in
master
and in
20 other branches
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: Roland Dreier <roland@purestorage.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff
drivers/target/target_core_iblock.c
... | ... | @@ -181,7 +181,7 @@ |
181 | 181 | */ |
182 | 182 | dev->se_sub_dev->se_dev_attrib.max_unmap_block_desc_count = 1; |
183 | 183 | dev->se_sub_dev->se_dev_attrib.unmap_granularity = |
184 | - q->limits.discard_granularity; | |
184 | + q->limits.discard_granularity >> 9; | |
185 | 185 | dev->se_sub_dev->se_dev_attrib.unmap_granularity_alignment = |
186 | 186 | q->limits.discard_alignment; |
187 | 187 |