From: Randy Dunlap <rdunlap@xenotime.net>
To: dgilbert@interlog.com
Cc: linux-scsi <linux-scsi@vger.kernel.org>,
James Bottomley <James.Bottomley@suse.de>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: Re: [PATCH] scsi_mid_low_api.txt recommend resid usage
Date: Fri, 24 Dec 2010 09:46:12 -0800 [thread overview]
Message-ID: <20101224094612.8056bbcd.rdunlap@xenotime.net> (raw)
In-Reply-To: <4D140825.6000704@interlog.com>
On Thu, 23 Dec 2010 21:40:37 -0500 Douglas Gilbert wrote:
> As discussed in a thread on this list titled:
> "RFC: short reads on block devices"
> this patch adds recommendations for LLDs to set resid
> when there might be uncertainty about how much data
> has been returned by a device.
>
> This patch inline and attached] is against scsi-misc-2.6.git
>
>
> Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
>
>
> diff --git a/Documentation/scsi/scsi_mid_low_api.txt
> b/Documentation/scsi/scsi_mid_low_api.txt
> index df322c1..7bcdea7 100644
> --- a/Documentation/scsi/scsi_mid_low_api.txt
> +++ b/Documentation/scsi/scsi_mid_low_api.txt
> @@ -1351,6 +1351,18 @@ Members of interest:
> report a DID_ERROR. Better for an LLD to implement
> 'resid'.
>
> +It is recommended that a LLD set 'resid' on data transfers from a SCSI
> +target device (e.g. READs). It is especially important that 'resid' is set
> +when such data transfers have sense keys of MEDIUM ERROR and HARDWARE ERROR
> +(and possibly RECOVERED ERROR). In these cases if a LLD is in doubt how much
> +data has been received then the safest approach is to indicate no bytes have
> +been received. For example: to indicate that no valid data has been received
> +a LLD might use these helpers:
> + scsi_set_resid(SCpnt, scsi_bufflen(SCpnt));
> +where 'SCpnt' is a pointer to a scsi_cmnd object. To indicate only three 512
> +bytes blocks has been received 'resid' could be set like this:
> + scsi_set_resid(SCpnt, scsi_bufflen(SCpnt) - (3 * 512));
> +
> The scsi_cmnd structure is defined in include/scsi/scsi_cmnd.h
Hi Doug,
Using "an LLD" instead of "a LLD" would be more consistent with the rest
of this txt file (and read better to me).
---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
desserts: http://www.xenotime.net/linux/recipes/
next prev parent reply other threads:[~2010-12-24 17:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-24 2:40 [PATCH] scsi_mid_low_api.txt recommend resid usage Douglas Gilbert
2010-12-24 17:46 ` Randy Dunlap [this message]
2010-12-24 20:17 ` Douglas Gilbert
2010-12-24 20:36 ` Randy Dunlap
2010-12-30 16:08 ` Douglas Gilbert
2010-12-30 17:50 ` Randy Dunlap
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=20101224094612.8056bbcd.rdunlap@xenotime.net \
--to=rdunlap@xenotime.net \
--cc=James.Bottomley@suse.de \
--cc=dgilbert@interlog.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/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;
as well as URLs for NNTP newsgroup(s).