Commit 154252fc authored by Matthew Dharm's avatar Matthew Dharm Committed by Greg Kroah-Hartman

[PATCH] USB Storage: Force INQUIRY length to be 36

This is patch as399, originally from Alan Stern.

A recent change to the scsi_probe_lun() routine now allows host drivers to
specify a device's INQUIRY length in a way that cannot be overridden by
the value returned from the device.  This patch makes usb-storage set the
length to 36; now buggy devices won't be able to cause trouble by saying
that they have 37 bytes of INQUIRY data available.

The only way this value could be changed is if someone creates a SCSI
blacklist entry with the BLIST_INQUIRY_58 flag -- and no one would do that
for a USB device (I hope)!
Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
Signed-off-by: default avatarMatthew Dharm <mdharm-usb@one-eyed-alien.net>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent c463696e
......@@ -73,14 +73,11 @@ static const char* host_info(struct Scsi_Host *host)
static int slave_alloc (struct scsi_device *sdev)
{
/*
* Set default bflags. These can be overridden for individual
* models and vendors via the scsi devinfo mechanism. The only
* flag we need is to force 36-byte INQUIRYs; we don't use any
* of the extra data and many devices choke if asked for more or
* Set the INQUIRY transfer length to 36. We don't use any of
* the extra data and many devices choke if asked for more or
* less than 36 bytes.
*/
sdev->sdev_bflags = BLIST_INQUIRY_36;
sdev->inquiry_len = 36;
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment