Message ID | 20220415045258.199825-4-hch@lst.de (mailing list archive) |
---|---|
State | Accepted |
Commit | 968786b9ef56e75e0109158a4936ffffea962c1e |
Headers | show |
Series | [01/27] target: remove an incorrect unmap zeroes data deduction | expand |
On 4/14/22 21:52, Christoph Hellwig wrote: > Use the proper bdev_discard_alignment helper that accounts for partition > offsets. > > Fixes: c66ac9db8d4a ("[SCSI] target: Add LIO target core v4.0.0-rc6") > Signed-off-by: Christoph Hellwig <hch@lst.de> > Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com> > --- Helper does handle the case for of partition. Looks good. Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com> -ck
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index 3a1ec705cd80b..16e775bcf4a7c 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c @@ -849,8 +849,8 @@ bool target_configure_unmap_from_queue(struct se_dev_attrib *attrib, */ attrib->max_unmap_block_desc_count = 1; attrib->unmap_granularity = q->limits.discard_granularity / block_size; - attrib->unmap_granularity_alignment = q->limits.discard_alignment / - block_size; + attrib->unmap_granularity_alignment = + bdev_discard_alignment(bdev) / block_size; return true; } EXPORT_SYMBOL(target_configure_unmap_from_queue);