From 77d41c15095749cfcedf9b0f9be8e940028af53c Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Fri, 16 Feb 2007 01:46:38 -0800 Subject: [PATCH] --- yaml --- r: 49107 b: refs/heads/master c: e423ee31db92d4e298c137814a4341e1cd05739e h: refs/heads/master i: 49105: 3effd8ec4f2efdf79f52adeca8934d632a379e56 49103: 530dedd89669b22903417e6c77f829fbeae4f094 v: v3 --- [refs] | 2 +- trunk/drivers/scsi/scsi_scan.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 140a277443c4..48efadb3e0bd 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a29fdd3c2a3e53b67baa5031372fd78fddaf48fa +refs/heads/master: e423ee31db92d4e298c137814a4341e1cd05739e diff --git a/trunk/drivers/scsi/scsi_scan.c b/trunk/drivers/scsi/scsi_scan.c index a43b9ec3aefd..7757e558d523 100644 --- a/trunk/drivers/scsi/scsi_scan.c +++ b/trunk/drivers/scsi/scsi_scan.c @@ -654,6 +654,19 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result, * short INQUIRY), an abort here prevents any further use of the * device, including spin up. * + * On the whole, the best approach seems to be to assume the first + * 36 bytes are valid no matter what the device says. That's + * better than copying < 36 bytes to the inquiry-result buffer + * and displaying garbage for the Vendor, Product, or Revision + * strings. + */ + if (sdev->inquiry_len < 36) { + printk(KERN_INFO "scsi scan: INQUIRY result too short (%d)," + " using 36\n", sdev->inquiry_len); + sdev->inquiry_len = 36; + } + + /* * Related to the above issue: * * XXX Devices (disk or all?) should be sent a TEST UNIT READY,