]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | Subject: Retry mode select in RDAC device handler |
2 | From: Chandra Seetharaman <sekharan@us.ibm.com> | |
3 | References: bnc#441337 | |
4 | ||
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. | |
8 | ||
9 | Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com> | |
10 | Signed-off-by: Hannes Reinecke <hare@suse.de> | |
11 | ||
12 | --- | |
13 | --- | |
14 | drivers/scsi/device_handler/scsi_dh_rdac.c | 15 +++++++++++---- | |
15 | 1 file changed, 11 insertions(+), 4 deletions(-) | |
16 | ||
17 | --- a/drivers/scsi/device_handler/scsi_dh_rdac.c | |
18 | +++ b/drivers/scsi/device_handler/scsi_dh_rdac.c | |
19 | @@ -24,6 +24,7 @@ | |
20 | #include <scsi/scsi_dh.h> | |
21 | ||
22 | #define RDAC_NAME "rdac" | |
23 | +#define RDAC_RETRY_COUNT 5 | |
24 | ||
25 | /* | |
26 | * LSI mode page stuff | |
27 | @@ -475,21 +476,27 @@ static int send_mode_select(struct scsi_ | |
28 | { | |
29 | struct request *rq; | |
30 | struct request_queue *q = sdev->request_queue; | |
31 | - int err = SCSI_DH_RES_TEMP_UNAVAIL; | |
32 | + int err, retry_cnt = RDAC_RETRY_COUNT; | |
33 | ||
34 | +retry: | |
35 | + err = SCSI_DH_RES_TEMP_UNAVAIL; | |
36 | rq = rdac_failover_get(sdev, h); | |
37 | if (!rq) | |
38 | goto done; | |
39 | ||
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"); | |
43 | ||
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--) | |
50 | + goto retry; | |
51 | + } | |
52 | if (err == SCSI_DH_OK) | |
53 | h->state = RDAC_STATE_ACTIVE; | |
54 | ||
55 | - blk_put_request(rq); | |
56 | done: | |
57 | return err; | |
58 | } |