Commit 10838a0e authored by Jens Axboe's avatar Jens Axboe Committed by James Bottomley

[PATCH] megaraid bad queuecommand return

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.   Just returning busy without calling
done() should be enough for appropriate retries.
Signed-off-by: default avatarJens Axboe <axboe@suse.de>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 543ce5ea
......@@ -634,11 +634,7 @@ mega_build_cmd(adapter_t *adapter, Scsi_Cmnd *cmd, int *busy)
}
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_Cmnd *cmd, int *busy)
/* 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_Cmnd *cmd, int *busy)
/* 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_Cmnd *cmd, int *busy)
/* 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_Cmnd *cmd, int *busy)
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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment