public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@suse.de>
To: linux-scsi@vger.kernel.org,
	James Bottomley <James.Bottomley@steeleye.com>
Subject: Re: [PATCH] megaraid bad queuecommand return
Date: Fri, 19 Nov 2004 13:17:06 +0100	[thread overview]
Message-ID: <20041119121706.GZ26240@suse.de> (raw)
In-Reply-To: <20041119085341.GY26240@suse.de>

On Fri, Nov 19 2004, Jens Axboe wrote:
> 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.

Of course the other way around for this particular patch - just return
busy and let the mid layer handle it, but make sure not to call done()
first.

> 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
> 
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

-- 
Jens Axboe


      reply	other threads:[~2004-11-19 12:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-19  8:53 [PATCH] megaraid bad queuecommand return Jens Axboe
2004-11-19 12:17 ` Jens Axboe [this message]

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=20041119121706.GZ26240@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