logo       

Re: [usb-storage] Re: 2 PATCHES: fix request_tranferlength: msg#00217

Subject: Re: [usb-storage] Re: 2 PATCHES: fix request_tranferlength
On Tue, Jul 30, 2002 at 09:40:12AM -0400, Douglas Gilbert wrote:
> Matthew Dharm wrote:
> > 
> > Out of curiosity... which value does the sg interface pass through?  It
> > collects both the buffer length and the requested transfer length, if my
> > memory serves...
> 
> Matt,
> The sg driver does not attempt to decode SCSI commands (and,
> for example, calculate allocation lengths) but simply passes
> them through. In the sg_io_hdr interface what the user gives
> as dxfer_len becomes the 4th argument to scsi_do_req() and
> hence becomes Scsi_Request::sr_bufflen in the mid and lower
> levels. The cumulative length of the elements in scatter gather 
> list built by sg (or the single buffer) is greater than or
> equal to dxfer_len.

Hrm....

Are you saying then that the sum of the sg segments can be greater than the
requested length?

After some discussions with Linus and others, I was under the impression
that this was a no-no...

Matt

-- 
Matthew Dharm                              Home: mdharm-usb@xxxxxxxxxxxxxxxxxx 
Maintainer, Linux USB Mass Storage Driver

Department of Justice agent.  I have come to purify the flock.
                                        -- DOJ agent
User Friendly, 5/22/1998

Attachment: pgpoRqEpxeRBr.pgp
Description: PGP signature

<Prev in Thread] Current Thread [Next in Thread>