1 Subject: Retry mode select in RDAC device handler
2 From: Chandra Seetharaman <sekharan@us.ibm.com>
5 When the mode select sent to the controller fails with the retryable
6 error, it is better to retry the mode_select from the hardware handler
7 itself, instead of propagating the failure to dm-multipath.
9 Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com>
10 Signed-off-by: Hannes Reinecke <hare@suse.de>
14 drivers/scsi/device_handler/scsi_dh_rdac.c | 15 +++++++++++----
15 1 file changed, 11 insertions(+), 4 deletions(-)
17 --- a/drivers/scsi/device_handler/scsi_dh_rdac.c
18 +++ b/drivers/scsi/device_handler/scsi_dh_rdac.c
20 #include <scsi/scsi_dh.h>
22 #define RDAC_NAME "rdac"
23 +#define RDAC_RETRY_COUNT 5
27 @@ -475,21 +476,27 @@ static int send_mode_select(struct scsi_
30 struct request_queue *q = sdev->request_queue;
31 - int err = SCSI_DH_RES_TEMP_UNAVAIL;
32 + int err, retry_cnt = RDAC_RETRY_COUNT;
35 + err = SCSI_DH_RES_TEMP_UNAVAIL;
36 rq = rdac_failover_get(sdev, h);
40 - sdev_printk(KERN_INFO, sdev, "queueing MODE_SELECT command.\n");
41 + sdev_printk(KERN_INFO, sdev, "%s MODE_SELECT command.\n",
42 + (retry_cnt == RDAC_RETRY_COUNT) ? "queueing" : "retrying");
44 err = blk_execute_rq(q, NULL, rq, 1);
45 - if (err != SCSI_DH_OK)
46 + blk_put_request(rq);
47 + if (err != SCSI_DH_OK) {
48 err = mode_select_handle_sense(sdev, h->sense);
49 + if (err == SCSI_DH_RETRY && retry_cnt--)
52 if (err == SCSI_DH_OK)
53 h->state = RDAC_STATE_ACTIVE;
55 - blk_put_request(rq);