All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: disable VPD page check on error
@ 2016-06-13 12:48 Hannes Reinecke
  2016-06-13 13:50 ` Ewan D. Milne
  0 siblings, 1 reply; 3+ messages in thread
From: Hannes Reinecke @ 2016-06-13 12:48 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: Christoph Hellwig, Paolo Bonzini, James Bottomley, linux-scsi,
	Hannes Reinecke, Hannes Reinecke

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 1deb6ad..0359864 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 = 1;
 		return;
 	}
 	if (result > vpd_len) {
@@ -822,6 +823,7 @@ retry_pg80:
 		result = scsi_vpd_inquiry(sdev, vpd_buf, 0x80, vpd_len);
 		if (result < 0) {
 			kfree(vpd_buf);
+			sdev->skip_vpd_pages = 1;
 			return;
 		}
 		if (result > vpd_len) {
@@ -851,6 +853,7 @@ retry_pg83:
 		result = scsi_vpd_inquiry(sdev, vpd_buf, 0x83, vpd_len);
 		if (result < 0) {
 			kfree(vpd_buf);
+			sdev->skip_vpd_pages = 1;
 			return;
 		}
 		if (result > vpd_len) {
-- 
1.8.5.6


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

end of thread, other threads:[~2016-06-13 13:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-13 12:48 [PATCH] scsi: disable VPD page check on error Hannes Reinecke
2016-06-13 13:50 ` Ewan D. Milne
2016-06-13 13:56   ` Hannes Reinecke

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.