From: Hannes Reinecke <hare@suse.de>
Date: Mon, 13 Jun 2016 12:07:05 +0200
Subject: scsi: disable VPD page check on error
References: bsc#981954
Patch-Mainline: submitted linux-scsi, 2016/06/13
If we encounter an error during VPD page scanning we should be
setting the 'skip_vpd_pages' bit to avoid further accesses.
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
drivers/scsi/scsi.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 4543d3c..00f922e 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -796,6 +796,7 @@ retry_pg0:
result = scsi_vpd_inquiry(sdev, vpd_buf, 0, vpd_len);
if (result < 0) {
kfree(vpd_buf);
+ sdev->skip_vpd_pages = true;
return;
}
if (result > vpd_len) {
@@ -823,6 +824,7 @@ retry_pg80:
result = scsi_vpd_inquiry(sdev, vpd->buf, 0x80, vpd_len);
if (result < 0) {
kfree(vpd);
+ sdev->skip_vpd_pages = true;
return;
}
if (result > vpd_len) {
@@ -852,6 +854,7 @@ retry_pg83:
result = scsi_vpd_inquiry(sdev, vpd->buf, 0x83, vpd_len);
if (result < 0) {
kfree(vpd);
+ sdev->skip_vpd_pages = true;
return;
}
if (result > vpd_len) {
--
1.8.5.6