]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blob - multipath-tools/patches/0088-RHBZ-1069811-configurable-prio-timeout.patch
multipath-tools: Update to snapshot from 2013-02-22
[people/amarx/ipfire-3.x.git] / multipath-tools / patches / 0088-RHBZ-1069811-configurable-prio-timeout.patch
1 ---
2 libmultipath/prio.c | 7 +++++++
3 libmultipath/prio.h | 1 +
4 libmultipath/prioritizers/alua_rtpg.c | 5 +++--
5 libmultipath/prioritizers/emc.c | 2 +-
6 libmultipath/prioritizers/hds.c | 2 +-
7 libmultipath/prioritizers/hp_sw.c | 2 +-
8 libmultipath/prioritizers/ontap.c | 4 ++--
9 libmultipath/prioritizers/rdac.c | 2 +-
10 multipath.conf.annotated | 5 +++--
11 multipath/multipath.conf.5 | 4 ++--
12 10 files changed, 22 insertions(+), 12 deletions(-)
13
14 Index: multipath-tools-130222/libmultipath/prio.c
15 ===================================================================
16 --- multipath-tools-130222.orig/libmultipath/prio.c
17 +++ multipath-tools-130222/libmultipath/prio.c
18 @@ -10,6 +10,13 @@
19
20 static LIST_HEAD(prioritizers);
21
22 +unsigned int get_prio_timeout(unsigned int default_timeout)
23 +{
24 + if (conf->checker_timeout)
25 + return conf->checker_timeout * 1000;
26 + return default_timeout;
27 +}
28 +
29 int init_prio (void)
30 {
31 if (!add_prio(DEFAULT_PRIO))
32 Index: multipath-tools-130222/libmultipath/prio.h
33 ===================================================================
34 --- multipath-tools-130222.orig/libmultipath/prio.h
35 +++ multipath-tools-130222/libmultipath/prio.h
36 @@ -51,6 +51,7 @@ struct prio {
37 int (*getprio)(struct path *, char *);
38 };
39
40 +unsigned int get_prio_timeout(unsigned int default_timeout);
41 int init_prio (void);
42 void cleanup_prio (void);
43 struct prio * add_prio (char *);
44 Index: multipath-tools-130222/libmultipath/prioritizers/alua_rtpg.c
45 ===================================================================
46 --- multipath-tools-130222.orig/libmultipath/prioritizers/alua_rtpg.c
47 +++ multipath-tools-130222/libmultipath/prioritizers/alua_rtpg.c
48 @@ -21,6 +21,7 @@
49 #define __user
50 #include <scsi/sg.h>
51
52 +#include "../prio.h"
53 #include "alua_rtpg.h"
54
55 #define SENSE_BUFF_LEN 32
56 @@ -134,7 +135,7 @@ do_inquiry(int fd, int evpd, unsigned in
57 hdr.dxfer_len = resplen;
58 hdr.sbp = sense;
59 hdr.mx_sb_len = sizeof(sense);
60 - hdr.timeout = DEF_TIMEOUT;
61 + hdr.timeout = get_prio_timeout(DEF_TIMEOUT);
62
63 if (ioctl(fd, SG_IO, &hdr) < 0) {
64 PRINT_DEBUG("do_inquiry: IOCTL failed!\n");
65 @@ -253,7 +254,7 @@ do_rtpg(int fd, void* resp, long resplen
66 hdr.dxfer_len = resplen;
67 hdr.mx_sb_len = sizeof(sense);
68 hdr.sbp = sense;
69 - hdr.timeout = DEF_TIMEOUT;
70 + hdr.timeout = get_prio_timeout(DEF_TIMEOUT);
71
72 if (ioctl(fd, SG_IO, &hdr) < 0)
73 return -RTPG_RTPG_FAILED;
74 Index: multipath-tools-130222/libmultipath/prioritizers/emc.c
75 ===================================================================
76 --- multipath-tools-130222.orig/libmultipath/prioritizers/emc.c
77 +++ multipath-tools-130222/libmultipath/prioritizers/emc.c
78 @@ -31,7 +31,7 @@ int emc_clariion_prio(const char *dev, i
79 io_hdr.dxferp = sense_buffer;
80 io_hdr.cmdp = inqCmdBlk;
81 io_hdr.sbp = sb;
82 - io_hdr.timeout = 60000;
83 + io_hdr.timeout = get_prio_timeout(60000);
84 io_hdr.pack_id = 0;
85 if (ioctl(fd, SG_IO, &io_hdr) < 0) {
86 pp_emc_log(0, "sending query command failed");
87 Index: multipath-tools-130222/libmultipath/prioritizers/hds.c
88 ===================================================================
89 --- multipath-tools-130222.orig/libmultipath/prioritizers/hds.c
90 +++ multipath-tools-130222/libmultipath/prioritizers/hds.c
91 @@ -114,7 +114,7 @@ int hds_modular_prio (const char *dev, i
92 io_hdr.dxferp = inqBuff;
93 io_hdr.cmdp = inqCmdBlk;
94 io_hdr.sbp = sense_buffer;
95 - io_hdr.timeout = 2000; /* TimeOut = 2 seconds */
96 + io_hdr.timeout = get_prio_timeout(2000); /* TimeOut = 2 seconds */
97
98 if (ioctl (fd, SG_IO, &io_hdr) < 0) {
99 pp_hds_log(0, "SG_IO error");
100 Index: multipath-tools-130222/libmultipath/prioritizers/hp_sw.c
101 ===================================================================
102 --- multipath-tools-130222.orig/libmultipath/prioritizers/hp_sw.c
103 +++ multipath-tools-130222/libmultipath/prioritizers/hp_sw.c
104 @@ -46,7 +46,7 @@ int hp_sw_prio(const char *dev, int fd)
105 io_hdr.dxfer_direction = SG_DXFER_NONE;
106 io_hdr.cmdp = turCmdBlk;
107 io_hdr.sbp = sb;
108 - io_hdr.timeout = 60000;
109 + io_hdr.timeout = get_prio_timeout(60000);
110 io_hdr.pack_id = 0;
111 retry:
112 if (ioctl(fd, SG_IO, &io_hdr) < 0) {
113 Index: multipath-tools-130222/libmultipath/prioritizers/ontap.c
114 ===================================================================
115 --- multipath-tools-130222.orig/libmultipath/prioritizers/ontap.c
116 +++ multipath-tools-130222/libmultipath/prioritizers/ontap.c
117 @@ -89,7 +89,7 @@ static int send_gva(const char *dev, int
118 io_hdr.dxferp = results;
119 io_hdr.cmdp = cdb;
120 io_hdr.sbp = sb;
121 - io_hdr.timeout = SG_TIMEOUT;
122 + io_hdr.timeout = get_prio_timeout(SG_TIMEOUT);
123 io_hdr.pack_id = 0;
124 if (ioctl(fd, SG_IO, &io_hdr) < 0) {
125 pp_ontap_log(0, "SG_IO ioctl failed, errno=%d", errno);
126 @@ -141,7 +141,7 @@ static int get_proxy(const char *dev, in
127 io_hdr.dxferp = results;
128 io_hdr.cmdp = cdb;
129 io_hdr.sbp = sb;
130 - io_hdr.timeout = SG_TIMEOUT;
131 + io_hdr.timeout = get_prio_timeout(SG_TIMEOUT);
132 io_hdr.pack_id = 0;
133 if (ioctl(fd, SG_IO, &io_hdr) < 0) {
134 pp_ontap_log(0, "ioctl sending inquiry command failed, "
135 Index: multipath-tools-130222/libmultipath/prioritizers/rdac.c
136 ===================================================================
137 --- multipath-tools-130222.orig/libmultipath/prioritizers/rdac.c
138 +++ multipath-tools-130222/libmultipath/prioritizers/rdac.c
139 @@ -31,7 +31,7 @@ int rdac_prio(const char *dev, int fd)
140 io_hdr.dxferp = sense_buffer;
141 io_hdr.cmdp = inqCmdBlk;
142 io_hdr.sbp = sb;
143 - io_hdr.timeout = 60000;
144 + io_hdr.timeout = get_prio_timeout(60000);
145 io_hdr.pack_id = 0;
146 if (ioctl(fd, SG_IO, &io_hdr) < 0) {
147 pp_rdac_log(0, "sending inquiry command failed");
148 Index: multipath-tools-130222/multipath.conf.annotated
149 ===================================================================
150 --- multipath-tools-130222.orig/multipath.conf.annotated
151 +++ multipath-tools-130222/multipath.conf.annotated
152 @@ -188,8 +188,9 @@
153 # #
154 # # name : checker_timeout
155 # # scope : multipath & multipathd
156 -# # desc : The timeout to use for path checkers that issue scsi
157 -# # commands with an explicit timeout, in seconds.
158 +# # desc : The timeout to use for path checkers and prioritizers
159 +# # that issue scsi commands with an explicit timeout, in
160 +# # seconds.
161 # # values : n > 0
162 # # default : taken from /sys/block/sd<x>/device/timeout
163 # checker_timeout 60
164 Index: multipath-tools-130222/multipath/multipath.conf.5
165 ===================================================================
166 --- multipath-tools-130222.orig/multipath/multipath.conf.5
167 +++ multipath-tools-130222/multipath/multipath.conf.5
168 @@ -321,8 +321,8 @@ maximum number of open fds is taken from
169 if that number is greated than 1024.
170 .TP
171 .B checker_timeout
172 -Specify the timeout to user for path checkers that issue scsi commands with an
173 -explicit timeout, in seconds; default taken from
174 +Specify the timeout to use for path checkers and prioritizers that issue scsi
175 +commands with an explicit timeout, in seconds; default taken from
176 .I /sys/block/sd<x>/device/timeout
177 .TP
178 .B fast_io_fail_tmo