2 libmultipath/checkers/rdac.c | 91 ++++++++++++++++++++++++++++++++++++++-----
3 libmultipath/discovery.c | 2
4 2 files changed, 81 insertions(+), 12 deletions(-)
6 Index: multipath-tools-130222/libmultipath/checkers/rdac.c
7 ===================================================================
8 --- multipath-tools-130222.orig/libmultipath/checkers/rdac.c
9 +++ multipath-tools-130222/libmultipath/checkers/rdac.c
11 #define MSG_RDAC_UP "rdac checker reports path is up"
12 #define MSG_RDAC_DOWN "rdac checker reports path is down"
13 #define MSG_RDAC_GHOST "rdac checker reports path is ghost"
14 +#define MSG_RDAC_DOWN_TYPE(STR) MSG_RDAC_DOWN": "STR
16 +#define RTPG_UNAVAILABLE 0x3
17 +#define RTPG_OFFLINE 0xE
18 +#define RTPG_TRANSITIONING 0xF
20 +#define RTPG_UNAVAIL_NON_RESPONSIVE 0x2
21 +#define RTPG_UNAVAIL_IN_RESET 0x3
22 +#define RTPG_UNAVAIL_CFW_DL1 0x4
23 +#define RTPG_UNAVAIL_CFW_DL2 0x5
24 +#define RTPG_UNAVAIL_QUIESCED 0x6
25 +#define RTPG_UNAVAIL_SERVICE_MODE 0x7
27 struct control_mode_page {
28 unsigned char header[8];
29 @@ -199,22 +211,64 @@ struct volume_access_inq
34 - char asym_access_state_cur;
37 char vendor_specific_cur;
40 + char vendor_specific_alt;
45 +*checker_msg_string(struct volume_access_inq *inq)
47 + /* lun not connected */
48 + if (((inq->PQ_PDT & 0xE0) == 0x20) || (inq->PQ_PDT & 0x7f))
49 + return MSG_RDAC_DOWN_TYPE("lun not connected");
51 + /* if no tpg data is available, give the generic path down message */
52 + if (!(inq->avtcvp & 0x10))
53 + return MSG_RDAC_DOWN;
55 + /* controller is booting up */
56 + if (((inq->aas_cur & 0x0F) == RTPG_TRANSITIONING) &&
57 + (inq->aas_alt & 0x0F) != RTPG_TRANSITIONING)
58 + return MSG_RDAC_DOWN_TYPE("ctlr is in startup sequence");
60 + /* if not unavailable, give generic message */
61 + if ((inq->aas_cur & 0x0F) != RTPG_UNAVAILABLE)
62 + return MSG_RDAC_DOWN;
64 + /* target port group unavailable */
65 + switch (inq->vendor_specific_cur) {
66 + case RTPG_UNAVAIL_NON_RESPONSIVE:
67 + return MSG_RDAC_DOWN_TYPE("non-responsive to queries");
68 + case RTPG_UNAVAIL_IN_RESET:
69 + return MSG_RDAC_DOWN_TYPE("ctlr held in reset");
70 + case RTPG_UNAVAIL_CFW_DL1:
71 + case RTPG_UNAVAIL_CFW_DL2:
72 + return MSG_RDAC_DOWN_TYPE("ctlr firmware downloading");
73 + case RTPG_UNAVAIL_QUIESCED:
74 + return MSG_RDAC_DOWN_TYPE("ctlr quiesced by admin request");
75 + case RTPG_UNAVAIL_SERVICE_MODE:
76 + return MSG_RDAC_DOWN_TYPE("ctlr is in service mode");
78 + return MSG_RDAC_DOWN_TYPE("ctlr is unavailable");
83 libcheck_check (struct checker * c)
85 struct volume_access_inq inq;
90 memset(&inq, 0, sizeof(struct volume_access_inq));
91 if (0 != do_inq(c->fd, 0xC9, &inq, sizeof(struct volume_access_inq),
96 } else if (((inq.PQ_PDT & 0xE0) == 0x20) || (inq.PQ_PDT & 0x7f)) {
97 /* LUN not connected*/
98 @@ -222,11 +276,27 @@ libcheck_check (struct checker * c)
102 - /* check if controller is reporting asymmetric access state of unavailable */
103 - if ((inq.avtcvp & 0x10) &&
104 - ((inq.asym_access_state_cur & 0x0F) == 0x3)) {
107 + /* If TPGDE bit set, evaluate TPG information */
108 + if ((inq.avtcvp & 0x10)) {
109 + switch (inq.aas_cur & 0x0F) {
110 + /* Never use the path if it reports unavailable */
111 + case RTPG_UNAVAILABLE:
115 + * If both controllers report transitioning, it
116 + * means mode select or STPG is being processed.
118 + * If this controller alone is transitioning, it's
119 + * booting and we shouldn't use it yet.
121 + case RTPG_TRANSITIONING:
122 + if ((inq.aas_alt & 0xF) != RTPG_TRANSITIONING) {
130 /* If owner set or ioship mode is enabled return PATH_UP always */
131 @@ -238,7 +308,8 @@ libcheck_check (struct checker * c)
135 - MSG(c, MSG_RDAC_DOWN);
136 + MSG(c, (inqfail) ? MSG_RDAC_DOWN_TYPE("inquiry failed") :
137 + checker_msg_string(&inq));
141 Index: multipath-tools-130222/libmultipath/discovery.c
142 ===================================================================
143 --- multipath-tools-130222.orig/libmultipath/discovery.c
144 +++ multipath-tools-130222/libmultipath/discovery.c
145 @@ -1116,8 +1116,6 @@ pathinfo (struct path *pp, vector hwtabl
146 if (!strlen(pp->wwid))
150 - pp->priority = PRIO_UNDEF;