On Tue, 25 Apr 2000, Eric Youngdale wrote:

> 
> ----- Original Message -----
> From: "Douglas Gilbert" <[EMAIL PROTECTED]>
...
> > In lk 2.3/2.4 with:
> >         int resid;              /* Number of bytes requested to be
> >                                    transferred less actual number
> >                                    transferred (0 if not supported) */
> > See aha152x or advansys drivers for examples of this. The sg driver
> > since lk 2.3.43 makes resid available to user applications.
> >
> > Also in lk 2.2, 2.3/2.4 there is:
> >         unsigned underflow;     /* Return error if less than
> >                                    this amount is transfered */
> > See the aic7xxx driver for an example.
> 
>     Not all upper level drivers pay attention to this.  In particular, the
> disk and cdrom driver will expect that either the full amount will be
> transferred, or that an error of some sort will be returned.  In the event
> of an error, it is expected that the sector number for the bad sector will
> be returned in the sense data, that all sectors up to the bad sector were
> processed correctly, and that none of the sectors after the bad sector were
> handled.  I believe that the tape driver
... does find out from the sense data what is transferred and what is not.

Note that in some cases it is not an error for a tape drive to return
less data than is requested. For instance, in variable block mode the
drive reads one tape block and returns data up to the number of bytes
requested. If the user does not know the size of the next block, the
common practice is to read with a large byte count and see how many bytes
are returned.

        Kai


-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]

Reply via email to