public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: SCSI development list <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] SCSI: make use of the residue value
Date: Sat, 08 Mar 2008 11:20:42 -0600	[thread overview]
Message-ID: <1204996842.2893.14.camel@localhost.localdomain> (raw)
In-Reply-To: <Pine.LNX.4.44L0.0803081110480.17487-100000@netrider.rowland.org>

On Sat, 2008-03-08 at 11:22 -0500, Alan Stern wrote:
> On Fri, 7 Mar 2008, James Bottomley wrote:
> 
> > On Wed, 2008-02-27 at 15:25 -0500, Alan Stern wrote:
> > > On 20 Feb 2008, Alan Stern wrote:
> > > 
> > > > This patch (as1036) causes the SCSI midlayer to take into account the
> > > > residue value provided by some low-level drivers.  There's at least
> > > > one situation (USB mass storage with the Bulk-only transport) where
> > > > the specification states that it is permissible for a device to
> > > > indicate some of the data was not transferred correctly merely by
> > > > setting the residue value, without issuing a Check Condition.
> > > 
> > > After a week, there hasn't been any feedback on this patch.  Has it
> > > been accepted?  Is there anything wrong with it?  Is it still on a
> > > "to-look-at" queue?
> > 
> > OK, I ran it through its paces, but it fails in testing.  A very fun
> > failure, actually, some disks fail to appear with udev.
> > 
> > The reason is they return a residue from the VPD inquiry.  What your
> > patch actually causes is the block layer to resubmit the command with
> > the residue and triggers an overrun error (because the length in the
> > command is now much longer than the data buffer).
> 
> Can you give any more details?
> 
> 	What was the transfer length of the original command?

Depends on how you instigate it.  If you use sg_inq it will be 252.

> 	What were the actual data length and the residue value?

Depends on the page and the drive.  Best way is 0x80 it also depends on
the driver (since a lot don't report a residue).  Mostly they seem to be
24 bytes.

> 	What were the length and data-buffer size of the
> 	resubmitted command?

The length remains the same, it's embedded in the command.  The failing
length reported at 2.

> > The bottom line is that this patch won't work with variable length
> > commands like inquiry that always return a residue.
> 
> You're saying that the amount of data returned is smaller that the 
> amount requested because the data is variable length, right?

Yes.

> Under these circumstances the block layer should not resubmit anything.
> That is, it should be smart enough to know that the "missing" data does
> not in fact exist, as opposed to not being returned because of a
> retryable device error.
> 
> Aren't requests for things like VPD distinguished from regular 
> data-block accesses by a flag in the request structure already?  The 
> block layer should take this flag into account when deciding whether to 
> continue trying to transfer the "missing" data.  Maybe that needs to be 
> fixed first.

I'm sure Jens will look at patches.

James



  reply	other threads:[~2008-03-08 17:20 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-27 20:25 [PATCH] SCSI: make use of the residue value Alan Stern
2008-03-08  0:17 ` James Bottomley
2008-03-08 16:22   ` Alan Stern
2008-03-08 17:20     ` James Bottomley [this message]
2008-03-08 22:35       ` Alan Stern
2008-03-09  0:24         ` James Bottomley
2008-03-09  3:05           ` Alan Stern
2008-03-09 14:44             ` James Bottomley
2008-03-09 19:13               ` Alan Stern
2008-03-09 19:34                 ` James Bottomley
2008-03-09 21:50                   ` Alan Stern
2008-03-10 13:42                     ` Boaz Harrosh
2008-03-10 14:11                       ` Alan Stern
2008-03-10 14:31                         ` Boaz Harrosh
2008-03-10 14:50                           ` Alan Stern
2008-05-23 21:00           ` Alan Stern
  -- strict thread matches above, loose matches on Subject: below --
2008-02-20 21:26 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=1204996842.2893.14.camel@localhost.localdomain \
    --to=james.bottomley@hansenpartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox