summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/device_handler
diff options
context:
space:
mode:
authorChandra Seetharaman <sekharan@us.ibm.com>2008-11-05 20:06:37 -0800
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-12-29 11:24:15 -0600
commitc85f8cb9254e60cd25a094329c9dc9185c2140e7 (patch)
tree9e1ebf4f6d8b0cdf3264f8a49bc97c36bf17c753 /drivers/scsi/device_handler
parent9eece961fc646e2652086dae42650d002e2d27e2 (diff)
downloadop-kernel-dev-c85f8cb9254e60cd25a094329c9dc9185c2140e7.zip
op-kernel-dev-c85f8cb9254e60cd25a094329c9dc9185c2140e7.tar.gz
[SCSI] scsi_dh: Retry mode select in rdac device handler
When the mode select sent to the controller fails with the retryable error, it is better to retry the mode_select from the hardware handler itself, instead of propagating the failure to dm-multipath. Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/device_handler')
-rw-r--r--drivers/scsi/device_handler/scsi_dh_rdac.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c
index ff07559..3e16a33 100644
--- a/drivers/scsi/device_handler/scsi_dh_rdac.c
+++ b/drivers/scsi/device_handler/scsi_dh_rdac.c
@@ -24,6 +24,7 @@
#include <scsi/scsi_dh.h>
#define RDAC_NAME "rdac"
+#define RDAC_RETRY_COUNT 5
/*
* LSI mode page stuff
@@ -478,21 +479,27 @@ static int send_mode_select(struct scsi_device *sdev, struct rdac_dh_data *h)
{
struct request *rq;
struct request_queue *q = sdev->request_queue;
- int err = SCSI_DH_RES_TEMP_UNAVAIL;
+ int err, retry_cnt = RDAC_RETRY_COUNT;
+retry:
+ err = SCSI_DH_RES_TEMP_UNAVAIL;
rq = rdac_failover_get(sdev, h);
if (!rq)
goto done;
- sdev_printk(KERN_INFO, sdev, "queueing MODE_SELECT command.\n");
+ sdev_printk(KERN_INFO, sdev, "%s MODE_SELECT command.\n",
+ (retry_cnt == RDAC_RETRY_COUNT) ? "queueing" : "retrying");
err = blk_execute_rq(q, NULL, rq, 1);
- if (err != SCSI_DH_OK)
+ blk_put_request(rq);
+ if (err != SCSI_DH_OK) {
err = mode_select_handle_sense(sdev, h->sense);
+ if (err == SCSI_DH_RETRY && retry_cnt--)
+ goto retry;
+ }
if (err == SCSI_DH_OK)
h->state = RDAC_STATE_ACTIVE;
- blk_put_request(rq);
done:
return err;
}
OpenPOWER on IntegriCloud