From: Boaz Harrosh <bharrosh@panasas.com>
To: James Bottomley <James.Bottomley@suse.de>,
linux-scsi <linux-scsi@vger.kernel.org>
Subject: A theoretical problem in scsi_io_copletion and ACTION*_RETRY
Date: Mon, 04 Jan 2010 14:43:17 +0200 [thread overview]
Message-ID: <4B41E265.4030907@panasas.com> (raw)
James hi.
There is a theoretical problem with the case of ACTION_RETRY / ACTION_DELAYED_RETRY
Since we are calling blk_end_request(...,good_bytes) regardless. We cannot just retry
if good_bytes != 0.
The proper returned sense and/or driver-result and/or "good_bytes == 0" is a concerted
effort of target+LLD+ULD. I would like to check for that condition as below. If you
are absolutely sure this condition can never happen then I'd like to replace below with
a BUG_ON.
BTW:
In the case of "good_bytes == 0" there is no point in calling blk_end_request()
at all, (It's not going to do anything), so we might want to separate the code
to actually check for retries condition first only if "good_bytes == 0" and do
release_buffers plus farther processing if not.
Boaz
---
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 326b228..4cd6900 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -827,6 +827,12 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes)
action = ACTION_FAIL;
}
+ if (action >= ACTION_RETRY && good_bytes)
+ /* We cannot just retry if above blk_end_request advanced on
+ * some good_bytes, so ACTION_REPREP
+ */
+ action = ACTION_REPREP;
+
do_action:
switch (action) {
case ACTION_FAIL:
reply other threads:[~2010-01-04 12:43 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=4B41E265.4030907@panasas.com \
--to=bharrosh@panasas.com \
--cc=James.Bottomley@suse.de \
--cc=linux-scsi@vger.kernel.org \
/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.