]> git.ipfire.org Git - ipfire-3.x.git/blob - multipath-tools/patches/0092-UPBZ-1104605-reload-on-rename.patch
465257c0c95a16e22deec0915a9adfd3b25964f1
[ipfire-3.x.git] / multipath-tools / patches / 0092-UPBZ-1104605-reload-on-rename.patch
1 ---
2 libmultipath/configure.c | 11 +++++++++++
3 libmultipath/configure.h | 1 +
4 libmultipath/devmapper.c | 3 +--
5 3 files changed, 13 insertions(+), 2 deletions(-)
6
7 Index: multipath-tools-130222/libmultipath/configure.c
8 ===================================================================
9 --- multipath-tools-130222.orig/libmultipath/configure.c
10 +++ multipath-tools-130222/libmultipath/configure.c
11 @@ -394,6 +394,8 @@ select_action (struct multipath * mpp, v
12 cmpp->alias, mpp->alias);
13 strncpy(mpp->alias_old, cmpp->alias, WWID_SIZE);
14 mpp->action = ACT_RENAME;
15 + if (force_reload)
16 + mpp->action = ACT_RENAME2;
17 return;
18 }
19 mpp->action = ACT_CREATE;
20 @@ -632,6 +634,15 @@ domap (struct multipath * mpp, char * pa
21 r = dm_rename(mpp->alias_old, mpp->alias);
22 break;
23
24 + case ACT_RENAME2:
25 + r = dm_rename(mpp->alias_old, mpp->alias);
26 + if (r) {
27 + r = dm_addmap_reload(mpp, params);
28 + if (r)
29 + r = dm_simplecmd_noflush(DM_DEVICE_RESUME, mpp->alias, MPATH_UDEV_RELOAD_FLAG);
30 + }
31 + break;
32 +
33 default:
34 break;
35 }
36 Index: multipath-tools-130222/libmultipath/configure.h
37 ===================================================================
38 --- multipath-tools-130222.orig/libmultipath/configure.h
39 +++ multipath-tools-130222/libmultipath/configure.h
40 @@ -18,6 +18,7 @@ enum actions {
41 ACT_RENAME,
42 ACT_CREATE,
43 ACT_RESIZE,
44 + ACT_RENAME2,
45 };
46
47 #define FLUSH_ONE 1
48 Index: multipath-tools-130222/libmultipath/devmapper.c
49 ===================================================================
50 --- multipath-tools-130222.orig/libmultipath/devmapper.c
51 +++ multipath-tools-130222/libmultipath/devmapper.c
52 @@ -565,10 +565,9 @@ dm_dev_t (const char * mapname, char * d
53 if (!dm_task_run(dmt))
54 goto out;
55
56 - if (!dm_task_get_info(dmt, &info))
57 + if (!dm_task_get_info(dmt, &info) || !info.exists)
58 goto out;
59
60 - r = info.open_count;
61 if (snprintf(dev_t, len, "%i:%i", info.major, info.minor) > len)
62 goto out;
63