From: Jens Axboe <axboe@suse.de>
To: linux-scsi@vger.kernel.org,
James Bottomley <James.Bottomley@steeleye.com>
Subject: [PATCH] megaraid bad queuecommand return
Date: Fri, 19 Nov 2004 09:53:41 +0100 [thread overview]
Message-ID: <20041119085341.GY26240@suse.de> (raw)
Hi,
In case of scb allocation failure, mega_build_cmd() can return NULL scb
but set busy, which causes a non-zero return from ->queuecommand() while
the scsi command has been completed. Flagging error and calling done
should be enough for appropriate retries.
Signed-off-by: Jens Axboe <axboe@suse.de>
===== drivers/scsi/megaraid.c 1.73 vs edited =====
--- 1.73/drivers/scsi/megaraid.c 2004-11-11 09:43:34 +01:00
+++ edited/drivers/scsi/megaraid.c 2004-11-19 09:03:43 +01:00
@@ -634,11 +634,7 @@ mega_build_cmd(adapter_t *adapter, Scsi_
}
if(!(scb = mega_allocate_scb(adapter, cmd))) {
-
- cmd->result = (DID_ERROR << 16);
- cmd->scsi_done(cmd);
*busy = 1;
-
return NULL;
}
@@ -677,11 +673,7 @@ mega_build_cmd(adapter_t *adapter, Scsi_
/* Allocate a SCB and initialize passthru */
if(!(scb = mega_allocate_scb(adapter, cmd))) {
-
- cmd->result = (DID_ERROR << 16);
- cmd->scsi_done(cmd);
*busy = 1;
-
return NULL;
}
pthru = scb->pthru;
@@ -723,11 +715,7 @@ mega_build_cmd(adapter_t *adapter, Scsi_
/* Allocate a SCB and initialize mailbox */
if(!(scb = mega_allocate_scb(adapter, cmd))) {
-
- cmd->result = (DID_ERROR << 16);
- cmd->scsi_done(cmd);
*busy = 1;
-
return NULL;
}
mbox = (mbox_t *)scb->raw_mbox;
@@ -867,11 +855,7 @@ mega_build_cmd(adapter_t *adapter, Scsi_
/* Allocate a SCB and initialize mailbox */
if(!(scb = mega_allocate_scb(adapter, cmd))) {
-
- cmd->result = (DID_ERROR << 16);
- cmd->scsi_done(cmd);
*busy = 1;
-
return NULL;
}
@@ -899,11 +883,7 @@ mega_build_cmd(adapter_t *adapter, Scsi_
else {
/* Allocate a SCB and initialize passthru */
if(!(scb = mega_allocate_scb(adapter, cmd))) {
-
- cmd->result = (DID_ERROR << 16);
- cmd->scsi_done(cmd);
*busy = 1;
-
return NULL;
}
--
Jens Axboe
next reply other threads:[~2004-11-19 8:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-19 8:53 Jens Axboe [this message]
2004-11-19 12:17 ` [PATCH] megaraid bad queuecommand return Jens Axboe
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=20041119085341.GY26240@suse.de \
--to=axboe@suse.de \
--cc=James.Bottomley@steeleye.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox