From: tom.ty89@gmail.com
To: linux-scsi@vger.kernel.org
Cc: Tom Yan <tom.ty89@gmail.com>
Subject: [PATCH 1/1] sd: fix lbprz discard granularity as expected
Date: Thu, 10 Mar 2016 16:16:18 +0800 [thread overview]
Message-ID: <56e12d57.4b43620a.4c8c0.ffff9bc5@mx.google.com> (raw)
From: Tom Yan <tom.ty89@gmail.com>
According to its own comment, the discard granularity should
fixed to the logical block size. However, the actual code has
it hardcoded as 1 byte. Changing it to logical_block_size.
Signed-off-by: Tom Yan <tom.ty89@gmail.com>
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index d749da7..5a5457a 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.2
next reply other threads:[~2016-03-10 8:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-10 8:16 tom.ty89 [this message]
2016-03-10 9:15 ` [PATCH 1/1] sd: fix lbprz discard granularity as expected Tom Yan
2016-03-11 2:16 ` Martin K. Petersen
2016-03-11 3:53 ` Tom Yan
2016-03-11 12:37 ` Martin K. Petersen
2016-03-11 14:55 ` Tom Yan
2016-03-11 21:41 ` Martin K. Petersen
2016-03-12 5:37 ` Tom Yan
2016-03-12 5:43 ` Tom Yan
2016-03-14 20:07 ` Martin K. Petersen
2016-03-11 2:08 ` 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=56e12d57.4b43620a.4c8c0.ffff9bc5@mx.google.com \
--to=tom.ty89@gmail.com \
--cc=linux-scsi@vger.kernel.org \
/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