lkml.org 
[lkml]   [2014]   [Jul]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 3/3] [SCSI] Make LBP quirk skip lbpme checks tests
Some block devices (such as Hyper-V passthrough SSDs) support logical
block provisioning (e.g. via UNMAP) but don't set lbpme thus disabling
discard. If the try_lbp quirk is in use skip lbpme checks that lead up
to the logical block provisioning tests.

Signed-off-by: Sitsofe Wheeler <sitsofe@yahoo.com>
---
drivers/scsi/sd.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 8249e51..8bf34bc 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2559,7 +2559,7 @@ static void sd_read_block_limits(struct scsi_disk *sdkp)

sdkp->max_ws_blocks = (u32)get_unaligned_be64(&buffer[36]);

- if (!sdkp->lbpme)
+ if (!sdkp->lbpme && !sdkp->device->try_lbp)
goto out;

lba_count = get_unaligned_be32(&buffer[20]);
@@ -2633,7 +2633,7 @@ static void sd_read_block_provisioning(struct scsi_disk *sdkp)
unsigned char *buffer;
const int vpd_len = 8;

- if (sdkp->lbpme == 0)
+ if (sdkp->lbpme == 0 && sdkp->device->test_lbp == 0)
return;

buffer = kmalloc(vpd_len, GFP_KERNEL);
--
1.9.3

\
 
 \ /
  Last update: 2014-07-24 10:43    [W:0.173 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site