diff options
author | Chandra Seetharaman <sekharan@us.ibm.com> | 2008-11-05 23:06:37 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-12-29 12:24:15 -0500 |
commit | c85f8cb9254e60cd25a094329c9dc9185c2140e7 (patch) | |
tree | 9e1ebf4f6d8b0cdf3264f8a49bc97c36bf17c753 /drivers | |
parent | 9eece961fc646e2652086dae42650d002e2d27e2 (diff) |
[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')
-rw-r--r-- | drivers/scsi/device_handler/scsi_dh_rdac.c | 15 |
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 ff07559c5fcd..3e16a33927cf 100644 --- a/drivers/scsi/device_handler/scsi_dh_rdac.c +++ b/drivers/scsi/device_handler/scsi_dh_rdac.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <scsi/scsi_dh.h> | 24 | #include <scsi/scsi_dh.h> |
25 | 25 | ||
26 | #define RDAC_NAME "rdac" | 26 | #define RDAC_NAME "rdac" |
27 | #define RDAC_RETRY_COUNT 5 | ||
27 | 28 | ||
28 | /* | 29 | /* |
29 | * LSI mode page stuff | 30 | * LSI mode page stuff |
@@ -478,21 +479,27 @@ static int send_mode_select(struct scsi_device *sdev, struct rdac_dh_data *h) | |||
478 | { | 479 | { |
479 | struct request *rq; | 480 | struct request *rq; |
480 | struct request_queue *q = sdev->request_queue; | 481 | struct request_queue *q = sdev->request_queue; |
481 | int err = SCSI_DH_RES_TEMP_UNAVAIL; | 482 | int err, retry_cnt = RDAC_RETRY_COUNT; |
482 | 483 | ||
484 | retry: | ||
485 | err = SCSI_DH_RES_TEMP_UNAVAIL; | ||
483 | rq = rdac_failover_get(sdev, h); | 486 | rq = rdac_failover_get(sdev, h); |
484 | if (!rq) | 487 | if (!rq) |
485 | goto done; | 488 | goto done; |
486 | 489 | ||
487 | sdev_printk(KERN_INFO, sdev, "queueing MODE_SELECT command.\n"); | 490 | sdev_printk(KERN_INFO, sdev, "%s MODE_SELECT command.\n", |
491 | (retry_cnt == RDAC_RETRY_COUNT) ? "queueing" : "retrying"); | ||
488 | 492 | ||
489 | err = blk_execute_rq(q, NULL, rq, 1); | 493 | err = blk_execute_rq(q, NULL, rq, 1); |
490 | if (err != SCSI_DH_OK) | 494 | blk_put_request(rq); |
495 | if (err != SCSI_DH_OK) { | ||
491 | err = mode_select_handle_sense(sdev, h->sense); | 496 | err = mode_select_handle_sense(sdev, h->sense); |
497 | if (err == SCSI_DH_RETRY && retry_cnt--) | ||
498 | goto retry; | ||
499 | } | ||
492 | if (err == SCSI_DH_OK) | 500 | if (err == SCSI_DH_OK) |
493 | h->state = RDAC_STATE_ACTIVE; | 501 | h->state = RDAC_STATE_ACTIVE; |
494 | 502 | ||
495 | blk_put_request(rq); | ||
496 | done: | 503 | done: |
497 | return err; | 504 | return err; |
498 | } | 505 | } |