Re: Proper handling of data underrun

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Douglas Gilbert <dougg@xxxxxxxxxx> wrote:

>      underflow    - LLD should place (DID_ERROR << 16) in 'result' if
>                     actual number of bytes transferred is less than this
>                     figure. Not many LLDs implement this check and some
>                     that do just output an error message to the log
>                     rather than report a DID_ERROR. Better for an LLD
>                     to implement 'resid'.

> Andreas,
> The last sentence is were the stress should be. It implies
> the LLD should use one or the other, preferably resid.

Ok.
BTW, resid is used in scsi_lib.c to set rq->data_len.
Who is actually evaluating this field -- the block layer 
(I have seen some usage in elevator.c)?

> Historically 'underflow' has been there the longest but was
> insufficient to distinguish between serious underflows
> (e.g. on a READ of a block device) and informative underflows
> (e.g. fetching a mode page with an arbitrarily large buffer).

> So 'resid' was added later and conveys more information and
> doesn't jump to conclusions that it is a serious error.
> Perhaps 'underflow' should be marked as deprecated.

> Is any data conveyed or is the underflow value the same
> as the requested length?

Value is the same as the requested length.

> See what happens if 'underflow' is ignored (i.e. not
> written to be the LLD) and DID_ERROR is not set in
> the host_byte.

Yes I will give it a try.
Thanks.


Regards,

Andreas

-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux