diff options
author | Martin K. Petersen <martin.petersen@oracle.com> | 2016-03-06 01:52:02 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-04-12 19:08:39 +0300 |
commit | 67aa7e6dd927c17103b3c5acb7eb50efb2372dab (patch) | |
tree | 9a9d435052d74368612a26c8eed313b7d01a4c59 | |
parent | e468298bd4f80e9353b2fe1273ad036a4abaf6e6 (diff) | |
download | linux-67aa7e6dd927c17103b3c5acb7eb50efb2372dab.tar.xz |
sd: Fix discard granularity when LBPRZ=1
commit 6540a65da90c09590897310e31993b1f6e28485a upstream.
Commit 397737223c59 ("sd: Make discard granularity match logical block
size when LBPRZ=1") accidentally set the granularity to one byte instead
of one logical block on devices that provide deterministic zeroes after
UNMAP.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reported-by: Mike Snitzer <snitzer@redhat.com>
Reviewed-by: Ewan Milne <emilne@redhat.com>
Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
Fixes: 397737223c59e89dca7305feb6528caef8fbef84
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/scsi/sd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index bb669d32ccd0..cc84ea7d09cc 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -648,7 +648,7 @@ static void sd_config_discard(struct scsi_disk *sdkp, unsigned int mode) */ if (sdkp->lbprz) { q->limits.discard_alignment = 0; - q->limits.discard_granularity = 1; + q->limits.discard_granularity = logical_block_size; } else { q->limits.discard_alignment = sdkp->unmap_alignment * logical_block_size; |