public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: Hillf Danton <dhillf@gmail.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH] fix id computation in scsi_eh_target_reset()
Date: Mon, 18 Oct 2010 00:33:13 -0500	[thread overview]
Message-ID: <4CBBDC19.1090806@cs.wisc.edu> (raw)
In-Reply-To: <AANLkTin-Tkj3Ab312usO2FWE57m3St2iG2oz881F-Zhw@mail.gmail.com>

On 10/14/2010 09:04 AM, Hillf Danton wrote:
> There seems that the id of the tgtr_scmd processed by
> scsi_try_target_reset() does not match the id in case that
> SUCCESS is returned by scsi_try_target_reset().
>
> The mismatch is fixed, and the loop to find the next highest
> is also simplified.
>
> Signed-off-by: Hillf Danton<dhillf@gmail.com>
> ---
>
> --- a/drivers/scsi/scsi_error.c	2010-09-13 07:07:38.000000000 +0800
> +++ b/drivers/scsi/scsi_error.c	2010-10-14 21:45:56.000000000 +0800
> @@ -1173,14 +1173,19 @@ static int scsi_eh_target_reset(struct S
>   			list_for_each_entry(scmd, work_q, eh_entry) {
>   				if (scmd_id(scmd)>  id&&
>   				(!tgtr_scmd ||
> -				     scmd_id(tgtr_scmd)>  scmd_id(scmd)))
> +				     scmd_id(tgtr_scmd)>  scmd_id(scmd))) {
>   						tgtr_scmd = scmd;
> +						if (1 + id == scmd_id(scmd))
> +							break;
> +				}
>   			}
>   		}
>   		if (!tgtr_scmd)
>   			/* no more commands, that's it */
>   			break;
>
> +		id = scmd_id(tgtr_scmd);
> +
>   		SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Sending target reset "
>   						  "to target %d\n",
>   						  current->comm, id));


Thanks. Fixes the extra target resets I have been seeing and commands 
not getting cleaned up properly.

Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>

  reply	other threads:[~2010-10-18  5:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-14 14:04 [PATCH] fix id computation in scsi_eh_target_reset() Hillf Danton
2010-10-18  5:33 ` Mike Christie [this message]
2010-10-25 20:53   ` James Bottomley
2010-10-26 14:04     ` Hillf Danton
2010-10-26 20:13       ` Mike Christie
2010-10-26 20:10         ` James Bottomley
2010-10-27 13:12         ` Hillf Danton
2010-10-26 23:07     ` Mike Christie
2010-10-26 23:09       ` James Bottomley
2010-10-27 18:18         ` Mike Christie
2010-10-28 13:29           ` Hillf Danton
2010-12-14 20:57           ` Mike Christie
2010-12-15  2:31             ` James Bottomley
2010-12-16 15:10             ` Hillf Danton

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=4CBBDC19.1090806@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=dhillf@gmail.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