diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2011-05-18 06:31:07 +0200 |
---|---|---|
committer | James Bottomley <jbottomley@parallels.com> | 2011-05-24 18:38:15 +0200 |
commit | 2a8cfad06ebbb68e8c113a39bdd653297fb9369c (patch) | |
tree | 5c1aea3f2d3a6a04116775bef20d405fb084e500 | |
parent | [SCSI] bfa: kdump fix (diff) | |
download | linux-2a8cfad06ebbb68e8c113a39bdd653297fb9369c.tar.xz linux-2a8cfad06ebbb68e8c113a39bdd653297fb9369c.zip |
[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: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
-rw-r--r-- | drivers/scsi/sd.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index bd0806e64e85..1c69c14be0cd 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -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 * + logical_block_size; q->limits.discard_granularity = max(sdkp->physical_block_size, sdkp->unmap_granularity * logical_block_size); |