Linux Device Mapper development
 help / color / mirror / Atom feed
* [PATCH] multipath: Retry host transient errors for rdac checker
@ 2011-03-01 19:08 Moger, Babu
  2011-03-07 23:00 ` Christophe Varoqui
  2011-04-05 20:35 ` [PATCH] scsi_dh_rdac: Adding couple more vendor product ids Moger, Babu
  0 siblings, 2 replies; 3+ messages in thread
From: Moger, Babu @ 2011-03-01 19:08 UTC (permalink / raw)
  To: dm-devel@redhat.com

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..

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))) {

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] multipath: Retry host transient errors for rdac checker
  2011-03-01 19:08 [PATCH] multipath: Retry host transient errors for rdac checker Moger, Babu
@ 2011-03-07 23:00 ` Christophe Varoqui
  2011-04-05 20:35 ` [PATCH] scsi_dh_rdac: Adding couple more vendor product ids Moger, Babu
  1 sibling, 0 replies; 3+ messages in thread
From: Christophe Varoqui @ 2011-03-07 23:00 UTC (permalink / raw)
  To: device-mapper development

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))) {
> 
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] scsi_dh_rdac: Adding couple more vendor product ids
  2011-03-01 19:08 [PATCH] multipath: Retry host transient errors for rdac checker Moger, Babu
  2011-03-07 23:00 ` Christophe Varoqui
@ 2011-04-05 20:35 ` Moger, Babu
  1 sibling, 0 replies; 3+ messages in thread
From: Moger, Babu @ 2011-04-05 20:35 UTC (permalink / raw)
  To: linux-scsi@vger.kernel.org; +Cc: device-mapper development

This patch adds couple more Vendor/Product IDs for RDAC.. There are no functional changes.

Signed-off-by: Babu Moger <babu.moger@lsi.com>
---
--- linux-2.6.39-rc1/drivers/scsi/device_handler/scsi_dh_rdac.c.orig	2011-04-05 15:01:52.000000000 -0500
+++ linux-2.6.39-rc1/drivers/scsi/device_handler/scsi_dh_rdac.c	2011-04-05 15:06:18.000000000 -0500
@@ -755,6 +755,7 @@ static const struct scsi_dh_devlist rdac
 	{"IBM", "3526"},
 	{"SGI", "TP9400"},
 	{"SGI", "TP9500"},
+	{"SGI", "TP9700"},
 	{"SGI", "IS"},
 	{"STK", "OPENstorage D280"},
 	{"SUN", "CSM200_R"},
@@ -774,6 +775,7 @@ static const struct scsi_dh_devlist rdac
 	{"SUN", "CSM100_R_FC"},
 	{"SUN", "STK6580_6780"},
 	{"SUN", "SUN_6180"},
+	{"SUN", "ArrayStorage"},
 	{NULL, NULL},
 };
 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-04-05 20:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-01 19:08 [PATCH] multipath: Retry host transient errors for rdac checker Moger, Babu
2011-03-07 23:00 ` Christophe Varoqui
2011-04-05 20:35 ` [PATCH] scsi_dh_rdac: Adding couple more vendor product ids Moger, Babu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox