public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Hannes Reinecke <hare@suse.de>
Cc: James Bottomley <jbottomley@parallels.com>,
	linux-scsi@vger.kernel.org, Mike Christie <michaelc@cs.wisc.edu>,
	Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH] scsi: Double completion on retry
Date: Thu, 02 May 2013 10:34:59 +0200	[thread overview]
Message-ID: <51822533.5080505@suse.de> (raw)
In-Reply-To: <1367483462-22576-1-git-send-email-hare@suse.de>

On 05/02/2013 10:31 AM, Hannes Reinecke wrote:
> When blk_end_request() returns 'false' in scsi_end_request the
> request is invalid after blk_end_request_all(). So we must not
> return the then stale request pointer. Doing so will result
> in a potential double completion.
> And we should be calling scsi_release_buffers() before
> blk_end_request_all().
> 
> Cc: Mike Christie <michaelc@cs.wisc.edu>
> Cc: Tejun Heo <tj@kernel.org>
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> 
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> index c31187d..8dba66b 100644
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -581,9 +581,11 @@ static struct scsi_cmnd *scsi_end_request(struct scsi_cmnd *cmd, int error,
>  	 */
>  	if (blk_end_request(req, error, bytes)) {
>  		/* kill remainder if no retrys */
> -		if (error && scsi_noretry_cmd(cmd))
> +		if (error && scsi_noretry_cmd(cmd)) {
> +			scsi_release_buffers(cmd);
>  			blk_end_request_all(req, error);
> -		else {
> +			cmd = NULL;
> +		} else {
>  			if (requeue) {
>  				/*
>  				 * Bleah.  Leftovers again.  Stick the
> 
Bah, forget it. Patch is wrong.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		      zSeries & Storage
hare@suse.de			      +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
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

      reply	other threads:[~2013-05-02  8:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-02  8:31 [PATCH] scsi: Double completion on retry Hannes Reinecke
2013-05-02  8:34 ` Hannes Reinecke [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=51822533.5080505@suse.de \
    --to=hare@suse.de \
    --cc=jbottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    --cc=tj@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