From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: linux-scsi@vger.kernel.org
Cc: snitzer@redhat.com,
"Martin K. Petersen" <martin.petersen@oracle.com>,
stable@vger.kernel.org#4.4+
Subject: [PATCH] sd: Fix discard granularity when LBPRZ=1
Date: Sat, 5 Mar 2016 18:10:21 -0500 [thread overview]
Message-ID: <1457219421-836-1-git-send-email-martin.petersen@oracle.com> (raw)
In-Reply-To: <20160304152409.GA31358@redhat.com>
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 determistic zeroes after
UNMAP.
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reported-by: Mike Snitzer <snitzer@redhat.com>
Fixes: 397737223c59e89dca7305feb6528caef8fbef84
Cc: <stable@vger.kernel.org> # 4.4+
---
drivers/scsi/sd.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
--
2.7.0
next prev parent reply other threads:[~2016-03-05 23:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-20 15:17 scsi-debug regression with 4.5-rc? Ewan Milne
2016-01-20 15:57 ` Martin K. Petersen
2016-03-04 15:24 ` Mike Snitzer
2016-03-05 22:44 ` Martin K. Petersen
2016-03-05 23:10 ` Martin K. Petersen [this message]
2016-03-07 15:42 ` [PATCH] sd: Fix discard granularity when LBPRZ=1 Ewan Milne
2016-03-08 2:21 ` Martin K. Petersen
2016-03-08 17:02 ` Bart Van Assche
2016-03-09 1:51 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1457219421-836-1-git-send-email-martin.petersen@oracle.com \
--to=martin.petersen@oracle.com \
--cc=linux-scsi@vger.kernel.org \
--cc=snitzer@redhat.com \
--cc=stable@vger.kernel.org#4.4+ \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).