]> git.ipfire.org Git - people/amarx/ipfire-3.x.git/blob - multipath-tools/patches/0075-RHBZ-1056976-reload-flag.patch
multipath-tools: Update to snapshot from 2013-02-22
[people/amarx/ipfire-3.x.git] / multipath-tools / patches / 0075-RHBZ-1056976-reload-flag.patch
1 ---
2 kpartx/devmapper.c | 4 ++--
3 kpartx/devmapper.h | 8 +++++++-
4 kpartx/kpartx.c | 6 +++---
5 libmultipath/configure.c | 4 ++--
6 libmultipath/devmapper.c | 26 ++++++++++++++------------
7 libmultipath/devmapper.h | 10 ++++++++--
8 multipathd/cli_handlers.c | 4 ++--
9 7 files changed, 38 insertions(+), 24 deletions(-)
10
11 Index: multipath-tools-130222/kpartx/devmapper.c
12 ===================================================================
13 --- multipath-tools-130222.orig/kpartx/devmapper.c
14 +++ multipath-tools-130222/kpartx/devmapper.c
15 @@ -60,7 +60,7 @@ dm_prereq (char * str, int x, int y, int
16 }
17
18 extern int
19 -dm_simplecmd (int task, const char *name, int no_flush, uint32_t *cookie) {
20 +dm_simplecmd (int task, const char *name, int no_flush, uint32_t *cookie, uint16_t udev_flags) {
21 int r = 0;
22 int udev_wait_flag = (task == DM_DEVICE_RESUME ||
23 task == DM_DEVICE_REMOVE);
24 @@ -78,7 +78,7 @@ dm_simplecmd (int task, const char *name
25 if (no_flush)
26 dm_task_no_flush(dmt);
27
28 - if (udev_wait_flag && !dm_task_set_cookie(dmt, cookie, (udev_sync)? 0 : DM_UDEV_DISABLE_LIBRARY_FALLBACK))
29 + if (udev_wait_flag && !dm_task_set_cookie(dmt, cookie, ((udev_sync)? 0 : DM_UDEV_DISABLE_LIBRARY_FALLBACK) | udev_flags))
30 goto out;
31 r = dm_task_run(dmt);
32
33 Index: multipath-tools-130222/kpartx/devmapper.h
34 ===================================================================
35 --- multipath-tools-130222.orig/kpartx/devmapper.h
36 +++ multipath-tools-130222/kpartx/devmapper.h
37 @@ -2,10 +2,16 @@
38 #define MINOR(dev) ((dev & 0xff) | ((dev >> 12) & 0xfff00))
39 #define MKDEV(ma,mi) ((mi & 0xff) | (ma << 8) | ((mi & ~0xff) << 12))
40
41 +#ifdef DM_SUBSYSTEM_UDEV_FLAG0
42 +#define MPATH_UDEV_RELOAD_FLAG DM_SUBSYSTEM_UDEV_FLAG0
43 +#else
44 +#define MPATH_UDEV_RELOAD_FLAG 0
45 +#endif
46 +
47 extern int udev_sync;
48
49 int dm_prereq (char *, int, int, int);
50 -int dm_simplecmd (int, const char *, int, uint32_t *);
51 +int dm_simplecmd (int, const char *, int, uint32_t *, uint16_t);
52 int dm_addmap (int, const char *, const char *, const char *, uint64_t,
53 int, const char *, int, mode_t, uid_t, gid_t, uint32_t *);
54 int dm_map_present (char *);
55 Index: multipath-tools-130222/kpartx/kpartx.c
56 ===================================================================
57 --- multipath-tools-130222.orig/kpartx/kpartx.c
58 +++ multipath-tools-130222/kpartx/kpartx.c
59 @@ -421,7 +421,7 @@ main(int argc, char **argv){
60 continue;
61
62 if (!dm_simplecmd(DM_DEVICE_REMOVE, partname,
63 - 0, &cookie)) {
64 + 0, &cookie, 0)) {
65 r++;
66 continue;
67 }
68 @@ -473,7 +473,7 @@ main(int argc, char **argv){
69 }
70 if (op == DM_DEVICE_RELOAD &&
71 !dm_simplecmd(DM_DEVICE_RESUME, partname,
72 - 1, &cookie)) {
73 + 1, &cookie, MPATH_UDEV_RELOAD_FLAG)) {
74 fprintf(stderr, "resume failed on %s\n",
75 partname);
76 r++;
77 @@ -505,7 +505,7 @@ main(int argc, char **argv){
78 continue;
79
80 if (!dm_simplecmd(DM_DEVICE_REMOVE,
81 - partname, 1, &cookie)) {
82 + partname, 1, &cookie, 0)) {
83 r++;
84 continue;
85 }
86 Index: multipath-tools-130222/libmultipath/configure.c
87 ===================================================================
88 --- multipath-tools-130222.orig/libmultipath/configure.c
89 +++ multipath-tools-130222/libmultipath/configure.c
90 @@ -390,13 +390,13 @@ domap (struct multipath * mpp, char * pa
91 case ACT_RELOAD:
92 r = dm_addmap_reload(mpp, params);
93 if (r)
94 - r = dm_simplecmd_noflush(DM_DEVICE_RESUME, mpp->alias);
95 + r = dm_simplecmd_noflush(DM_DEVICE_RESUME, mpp->alias, MPATH_UDEV_RELOAD_FLAG);
96 break;
97
98 case ACT_RESIZE:
99 r = dm_addmap_reload(mpp, params);
100 if (r)
101 - r = dm_simplecmd_flush(DM_DEVICE_RESUME, mpp->alias, 1);
102 + r = dm_simplecmd_flush(DM_DEVICE_RESUME, mpp->alias, 1, 0);
103 break;
104
105 case ACT_RENAME:
106 Index: multipath-tools-130222/libmultipath/devmapper.c
107 ===================================================================
108 --- multipath-tools-130222.orig/libmultipath/devmapper.c
109 +++ multipath-tools-130222/libmultipath/devmapper.c
110 @@ -103,7 +103,9 @@ dm_lib_prereq (void)
111 {
112 char version[64];
113 int v[3];
114 -#ifdef LIBDM_API_COOKIE
115 +#if defined(DM_SUBSYSTEM_UDEV_FLAG0)
116 + int minv[3] = {1, 2, 82};
117 +#elif defined(LIBDM_API_COOKIE)
118 int minv[3] = {1, 2, 38};
119 #else
120 int minv[3] = {1, 2, 8};
121 @@ -200,7 +202,7 @@ dm_prereq (void)
122 }
123
124 static int
125 -dm_simplecmd (int task, const char *name, int no_flush, int need_sync) {
126 +dm_simplecmd (int task, const char *name, int no_flush, int need_sync, uint16_t udev_flags) {
127 int r = 0;
128 int udev_wait_flag = (need_sync && (task == DM_DEVICE_RESUME ||
129 task == DM_DEVICE_REMOVE));
130 @@ -219,7 +221,7 @@ dm_simplecmd (int task, const char *name
131 dm_task_no_flush(dmt); /* for DM_DEVICE_SUSPEND/RESUME */
132 #endif
133
134 - if (udev_wait_flag && !dm_task_set_cookie(dmt, &conf->cookie, (conf->daemon)? DM_UDEV_DISABLE_LIBRARY_FALLBACK : 0))
135 + if (udev_wait_flag && !dm_task_set_cookie(dmt, &conf->cookie, ((conf->daemon)? DM_UDEV_DISABLE_LIBRARY_FALLBACK : 0) | udev_flags))
136 goto out;
137 r = dm_task_run (dmt);
138
139 @@ -229,13 +231,13 @@ dm_simplecmd (int task, const char *name
140 }
141
142 extern int
143 -dm_simplecmd_flush (int task, const char *name, int needsync) {
144 - return dm_simplecmd(task, name, 0, needsync);
145 +dm_simplecmd_flush (int task, const char *name, int needsync, uint16_t udev_flags) {
146 + return dm_simplecmd(task, name, 0, needsync, udev_flags);
147 }
148
149 extern int
150 -dm_simplecmd_noflush (int task, const char *name) {
151 - return dm_simplecmd(task, name, 1, 1);
152 +dm_simplecmd_noflush (int task, const char *name, uint16_t udev_flags) {
153 + return dm_simplecmd(task, name, 1, 1, udev_flags);
154 }
155
156 extern int
157 @@ -670,7 +672,7 @@ _dm_flush_map (const char * mapname, int
158 return 1;
159 }
160
161 - r = dm_simplecmd_flush(DM_DEVICE_REMOVE, mapname, need_sync);
162 + r = dm_simplecmd_flush(DM_DEVICE_REMOVE, mapname, need_sync, 0);
163
164 if (r) {
165 condlog(4, "multipath map %s removed", mapname);
166 @@ -703,14 +705,14 @@ dm_suspend_and_flush_map (const char * m
167 if (s)
168 queue_if_no_path = 0;
169 else
170 - s = dm_simplecmd_flush(DM_DEVICE_SUSPEND, mapname, 0);
171 + s = dm_simplecmd_flush(DM_DEVICE_SUSPEND, mapname, 0, 0);
172
173 if (!dm_flush_map(mapname)) {
174 condlog(4, "multipath map %s removed", mapname);
175 return 0;
176 }
177 condlog(2, "failed to remove multipath map %s", mapname);
178 - dm_simplecmd_noflush(DM_DEVICE_RESUME, mapname);
179 + dm_simplecmd_noflush(DM_DEVICE_RESUME, mapname, 0);
180 if (queue_if_no_path)
181 s = dm_queue_if_no_path((char *)mapname, 1);
182 return 1;
183 @@ -1077,7 +1079,7 @@ dm_remove_partmaps (const char * mapname
184 condlog(4, "partition map %s removed",
185 names->name);
186 dm_simplecmd_flush(DM_DEVICE_REMOVE, names->name,
187 - need_sync);
188 + need_sync, 0);
189 }
190
191 next = names->next;
192 @@ -1305,7 +1307,7 @@ int dm_reassign_table(const char *name,
193 condlog(3, "%s: failed to reassign targets", name);
194 goto out_reload;
195 }
196 - dm_simplecmd_noflush(DM_DEVICE_RESUME, name);
197 + dm_simplecmd_noflush(DM_DEVICE_RESUME, name, MPATH_UDEV_RELOAD_FLAG);
198 }
199 r = 1;
200
201 Index: multipath-tools-130222/libmultipath/devmapper.h
202 ===================================================================
203 --- multipath-tools-130222.orig/libmultipath/devmapper.h
204 +++ multipath-tools-130222/libmultipath/devmapper.h
205 @@ -6,11 +6,17 @@
206 #define TGT_MPATH "multipath"
207 #define TGT_PART "linear"
208
209 +#ifdef DM_SUBSYSTEM_UDEV_FLAG0
210 +#define MPATH_UDEV_RELOAD_FLAG DM_SUBSYSTEM_UDEV_FLAG0
211 +#else
212 +#define MPATH_UDEV_RELOAD_FLAG 0
213 +#endif
214 +
215 void dm_init(void);
216 int dm_prereq (void);
217 int dm_drv_version (unsigned int * version, char * str);
218 -int dm_simplecmd_flush (int, const char *, int);
219 -int dm_simplecmd_noflush (int, const char *);
220 +int dm_simplecmd_flush (int, const char *, int, uint16_t);
221 +int dm_simplecmd_noflush (int, const char *, uint16_t);
222 int dm_addmap_create (struct multipath *mpp, char *params);
223 int dm_addmap_reload (struct multipath *mpp, char *params);
224 int dm_map_present (const char *);
225 Index: multipath-tools-130222/multipathd/cli_handlers.c
226 ===================================================================
227 --- multipath-tools-130222.orig/multipathd/cli_handlers.c
228 +++ multipath-tools-130222/multipathd/cli_handlers.c
229 @@ -783,7 +783,7 @@ cli_suspend(void * v, char ** reply, int
230 {
231 struct vectors * vecs = (struct vectors *)data;
232 char * param = get_keyparam(v, MAP);
233 - int r = dm_simplecmd_noflush(DM_DEVICE_SUSPEND, param);
234 + int r = dm_simplecmd_noflush(DM_DEVICE_SUSPEND, param, 0);
235
236 param = convert_dev(param, 0);
237 condlog(2, "%s: suspend (operator)", param);
238 @@ -805,7 +805,7 @@ cli_resume(void * v, char ** reply, int
239 {
240 struct vectors * vecs = (struct vectors *)data;
241 char * param = get_keyparam(v, MAP);
242 - int r = dm_simplecmd_noflush(DM_DEVICE_RESUME, param);
243 + int r = dm_simplecmd_noflush(DM_DEVICE_RESUME, param, 0);
244
245 param = convert_dev(param, 0);
246 condlog(2, "%s: resume (operator)", param);