Commit ec371326 authored by Oliver Neukum's avatar Oliver Neukum Committed by Greg Kroah-Hartman

usb-storage: support for more than 8 LUNs

This is necessary to make some storage arrays work.

Some storage devices have more than 8 LUNs. In addition
you can hook up a WideSCSI bus to USB. In these cases even
level 2 devices can have more than 8 LUNs. For them
it is necessary to simply believe the class specific
command and report its result back to the SCSI layer.

Off by one Alan noticed is fixed.
Signed-off-by: default avatarOliver Neukum <oneukum@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 59e980ef
...@@ -889,6 +889,12 @@ static void usb_stor_scan_dwork(struct work_struct *work) ...@@ -889,6 +889,12 @@ static void usb_stor_scan_dwork(struct work_struct *work)
!(us->fflags & US_FL_SCM_MULT_TARG)) { !(us->fflags & US_FL_SCM_MULT_TARG)) {
mutex_lock(&us->dev_mutex); mutex_lock(&us->dev_mutex);
us->max_lun = usb_stor_Bulk_max_lun(us); us->max_lun = usb_stor_Bulk_max_lun(us);
/*
* Allow proper scanning of devices that present more than 8 LUNs
* While not affecting other devices that may need the previous behavior
*/
if (us->max_lun >= 8)
us_to_host(us)->max_lun = us->max_lun+1;
mutex_unlock(&us->dev_mutex); mutex_unlock(&us->dev_mutex);
} }
scsi_scan_host(us_to_host(us)); scsi_scan_host(us_to_host(us));
......
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