From: Douglas Gilbert <dgilbert@interlog.com>
To: linux-scsi <linux-scsi@vger.kernel.org>
Cc: James Bottomley <James.Bottomley@suse.de>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Subject: [PATCH] scsi_debug: set resid to indicate no data-in when medium error
Date: Fri, 17 Dec 2010 19:16:06 -0500 [thread overview]
Message-ID: <4D0BFD46.3030505@interlog.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 471 bytes --]
As discussed in a thread on this list titled:
"RFC: short reads on block devices"
this patch provides additional information associated
with a medium error. And that is that the data-in buffer
contains no valid data.
This patch is against lk 2.6.36
Changelog:
set resid to the requested data-in length when a
MEDIUM ERROR is simulated. This implies no valid
data is returned in the data-in buffer
Signed-off-by: Douglas Gilbert <dgilbert@interlog.com>
[-- Attachment #2: sdebug2636resid1.diff --]
[-- Type: text/x-patch, Size: 401 bytes --]
--- linux/drivers/scsi/scsi_debug.c 2010-12-03 17:17:54.000000000 -0500
+++ linux/drivers/scsi/scsi_debug.c2636resid1 2010-12-16 00:48:25.000000000 -0500
@@ -1790,6 +1790,7 @@ static int resp_read(struct scsi_cmnd *S
devip->sense_buff[5] = (ret >> 8) & 0xff;
devip->sense_buff[6] = ret & 0xff;
}
+ scsi_set_resid(SCpnt, scsi_bufflen(SCpnt));
return check_condition_result;
}
reply other threads:[~2010-12-18 0:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=4D0BFD46.3030505@interlog.com \
--to=dgilbert@interlog.com \
--cc=James.Bottomley@suse.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.