public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] sd: fix lbprz discard granularity as expected
@ 2016-03-10  8:16 tom.ty89
  2016-03-10  9:15 ` Tom Yan
  2016-03-11  2:08 ` Martin K. Petersen
  0 siblings, 2 replies; 11+ messages in thread
From: tom.ty89 @ 2016-03-10  8:16 UTC (permalink / raw)
  To: linux-scsi; +Cc: Tom Yan

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


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-03-14 20:07 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-10  8:16 [PATCH 1/1] sd: fix lbprz discard granularity as expected tom.ty89
2016-03-10  9:15 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox