Commit 2a8cfad0 authored by Martin K. Petersen's avatar Martin K. Petersen Committed by James Bottomley

[SCSI] sd: Unmap discard alignment needs to be converted to bytes

The block layer discard alignment is reported in bytes, not in units of
the logical block size.
Signed-off-by: default avatarMartin K. Petersen <>
Signed-off-by: default avatarJames Bottomley <>
parent 45d7f0cc
......@@ -490,7 +490,8 @@ static void sd_config_discard(struct scsi_disk *sdkp, unsigned int mode)
unsigned int max_blocks = 0;
q->limits.discard_zeroes_data = sdkp->lbprz;
q->limits.discard_alignment = sdkp->unmap_alignment;
q->limits.discard_alignment = sdkp->unmap_alignment *
q->limits.discard_granularity =
sdkp->unmap_granularity * logical_block_size);
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