Linux Device Mapper development
 help / color / mirror / Atom feed
From: Christophe Varoqui <christophe.varoqui@gmail.com>
To: device-mapper development <dm-devel@redhat.com>
Subject: Re: [PATCH] multipath: Retry host transient errors for rdac checker
Date: Tue, 08 Mar 2011 00:00:54 +0100	[thread overview]
Message-ID: <1299538854.834.11.camel@zezette> (raw)
In-Reply-To: <E463DF2B2E584B4A82673F53D62C2EF4FF7DC637@cosmail01.lsi.com>

On mar., 2011-03-01 at 12:08 -0700, Moger, Babu wrote:
> Sometimes if the host is in transient state, we need to wait till the devloss timeout to
> expire before switching path group. We have seen in some cases path group switch happens
> even before the devloss timeout expire. This patch fixes the problem for rdac checker..
> 
I did not see comments on this patch.
It's now applied upstream.

-- 
Christophe Varoqui <christophe.varoqui@opensvc.com>
OpenSVC

> Signed-off-by: Babu Moger <babu.moger@lsi.com>
> ---
> --- multipath-tools/libmultipath/checkers/rdac.c.orig	2011-02-16 13:58:06.000000000 -0600
> +++ multipath-tools/libmultipath/checkers/rdac.c	2011-02-17 12:01:23.000000000 -0600
> @@ -48,7 +48,9 @@
>  	unsigned char inqCmdBlk[INQUIRY_CMDLEN] = { INQUIRY_CMD, 1, 0, 0, 0, 0 };
>  	unsigned char sense_b[SENSE_BUFF_LEN];
>  	struct sg_io_hdr io_hdr;
> +	int retry_rdac = 5;
>  
> +retry:
>  	inqCmdBlk[2] = (unsigned char) pg_op;
>  	inqCmdBlk[4] = (unsigned char) (mx_resp_len & 0xff);
>  	memset(&io_hdr, 0, sizeof (struct sg_io_hdr));
> @@ -72,6 +74,22 @@
>  	if ((0 == io_hdr.status) && (0 == io_hdr.host_status) &&
>  	    (0 == io_hdr.driver_status))
>  		return 0;
> +
> +	/* check if we need to retry this error */
> +	if (io_hdr.info & SG_INFO_OK_MASK) {
> +		switch (io_hdr.host_status) {
> +		case DID_BUS_BUSY:
> +		case DID_ERROR:
> +		case DID_TRANSPORT_DISRUPTED:
> +			/* Transport error, retry */
> +			if (--retry_rdac)
> +				goto retry;
> +			break;
> +		default:
> +			break;
> +		}
> +	}
> +
>  	if ((SCSI_CHECK_CONDITION == io_hdr.status) ||
>  	    (SCSI_COMMAND_TERMINATED == io_hdr.status) ||
>  	    (SG_ERR_DRIVER_SENSE == (0xf & io_hdr.driver_status))) {
> 
> 

  reply	other threads:[~2011-03-07 23:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-01 19:08 [PATCH] multipath: Retry host transient errors for rdac checker Moger, Babu
2011-03-07 23:00 ` Christophe Varoqui [this message]
2011-04-05 20:35 ` [PATCH] scsi_dh_rdac: Adding couple more vendor product ids Moger, Babu

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=1299538854.834.11.camel@zezette \
    --to=christophe.varoqui@gmail.com \
    --cc=christophe.varoqui@opensvc.com \
    --cc=dm-devel@redhat.com \
    /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