summaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorMartin K. Petersen <martin.petersen@oracle.com>2016-03-05 17:52:02 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2016-03-14 15:50:06 -0400
commitf4327a95dd080ed6aecb185478a88ce1ee4fa3c4 (patch)
treecd38ef4c0b5787c4f63d9f717bfb64d8555bf4ec /drivers/scsi
parent688875826f0dfbe34d9eda4c47b707d08130fe7b (diff)
downloadlinux-f4327a95dd080ed6aecb185478a88ce1ee4fa3c4.tar.gz
linux-f4327a95dd080ed6aecb185478a88ce1ee4fa3c4.tar.bz2
linux-f4327a95dd080ed6aecb185478a88ce1ee4fa3c4.zip
sd: Fix discard granularity when LBPRZ=1
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 Cc: <stable@vger.kernel.org> #v4.4+
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/sd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index d749da765df1..5a5457ac9cdb 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;