All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: "Örjan Nordlund" <orjan.nordlund@gmail.com>,
	"SCSI development list" <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] SCSI: detect missing data for INQUIRY
Date: Mon, 27 Oct 2008 12:08:36 -0500	[thread overview]
Message-ID: <1225127316.5146.32.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0810271258200.2296-100000@iolanthe.rowland.org>

On Mon, 2008-10-27 at 13:00 -0400, Alan Stern wrote:
> On Mon, 27 Oct 2008, James Bottomley wrote:
> 
> > > --- usb-2.6.orig/drivers/scsi/scsi_scan.c
> > > +++ usb-2.6/drivers/scsi/scsi_scan.c
> > > @@ -602,6 +602,13 @@ static int scsi_probe_lun(struct scsi_de
> > >  				    (sshdr.ascq == 0))
> > >  					continue;
> > >  			}
> > > +		} else {
> > > +			/*
> > > +			 * Additional Length and Vendor fields missing
> > > +			 * probably means nothing was transferred.  Try again.
> > > +			 */
> > > +			if (inq_result[4] == 0 && inq_result[8] == 0)
> > > +				continue;
> > 
> > Really, no.
> > 
> > A legitimate minimal response from a device is zero in the additional
> > length field.  If it does that, then the vendor field is bound to be
> > zero as well.
> > 
> > About the best we can do is check the first four fields.  For them to be
> > all zero, it would have to be a minimal response SCSI-1 device (RDF of
> > zero) ... hopefully they're all dead by now.
> 
> Then you're saying that the patch should everything up to
> inq_result[8]?  Or maybe even beyond?  I can do that.  Would that be 
> acceptable?

No ... "first four fields" means everything up to inq_result[3].
Anything beyond that would be legitimately zero if they were.

James



  reply	other threads:[~2008-10-27 17:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-27 16:18 [PATCH] SCSI: detect missing data for INQUIRY Alan Stern
2008-10-27 16:37 ` James Bottomley
2008-10-27 17:00   ` Alan Stern
2008-10-27 17:08     ` James Bottomley [this message]
2008-10-27 17:27       ` Alan Stern
2008-10-27 17:29         ` James Bottomley
2008-10-27 18:53           ` [PATCH v2] " Alan Stern
2008-10-28 13:02             ` James Smart
2008-10-28 13:43               ` Alan Stern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1225127316.5146.32.camel@localhost.localdomain \
    --to=james.bottomley@hansenpartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=orjan.nordlund@gmail.com \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.