On Tue, 12 Oct 2004, Michael Tokarev wrote:

> Aha, I see.  Thank you very much, Alan!
> 
> > http://marc.theaimsgroup.com/?l=linux-usb-devel&m=109623013027142&w=2
> 
> BTW, this change is a bit strange still (only a bit,
> really - mostly cosmetic).  I'd remove us->iobuf[0] = 0
> initialization and restore "result > 0" condition back,
> so that all other cases will be "handled" below that
> only normal return, together with the comment  (the
> only prob with this is a possibility to use uninitized
> us->iobuf[0] in debug output).

I don't understand your point -- that's exactly what the patch does.

> Still, the usb_stor_acquire_resources() routine should
> be fixed as well -- if the device is listed in
> unusual_devs with US_FL_SINGLE_LUN flag, don't call
> usb_stor_Bulk_max_lun() at all, like this:
> 
> instead of
> 
>    if (us->protocol == US_PR_BULK) {
>            p = usb_stor_Bulk_max_lun(us);
>    ...
> 
> the condition might be
> 
>    (us->protocol == US_PR_BULK && !(us->flags & US_FL_SINGLE_LUN))

I don't think this is needed.  The effect of your change would be to
prevent calling usb_stor_Bulk_max_lun when the SINGLE_LUN flag is set.  As 
a result we would assume only one LUN even when the device actually has 
more -- or when it _says_ it has more.  I've never heard of any device 
that says it has more than one LUN when that isn't true.  Nor have I 
heard of a Bulk-only device that crashes when it receives a GetMaxLUN 
request (even though a lot of devices fail to reply properly).

The real purpose of the SINGLE_LUN flag is to prevent scanning for more 
than one LUN when the device only has one but has no way to tell us that.  
Especially when the device doesn't fail commands with LUN > 0.

Alan Stern



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to