summaryrefslogtreecommitdiffstats
path: root/0092-UPBZ-1104605-reload-on-rename.patch
blob: 465257c0c95a16e22deec0915a9adfd3b25964f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
---
 libmultipath/configure.c |   11 +++++++++++
 libmultipath/configure.h |    1 +
 libmultipath/devmapper.c |    3 +--
 3 files changed, 13 insertions(+), 2 deletions(-)

Index: multipath-tools-130222/libmultipath/configure.c
===================================================================
--- multipath-tools-130222.orig/libmultipath/configure.c
+++ multipath-tools-130222/libmultipath/configure.c
@@ -394,6 +394,8 @@ select_action (struct multipath * mpp, v
 				cmpp->alias, mpp->alias);
 			strncpy(mpp->alias_old, cmpp->alias, WWID_SIZE);
 			mpp->action = ACT_RENAME;
+			if (force_reload)
+				mpp->action = ACT_RENAME2;
 			return;
 		}
 		mpp->action = ACT_CREATE;
@@ -632,6 +634,15 @@ domap (struct multipath * mpp, char * pa
 		r = dm_rename(mpp->alias_old, mpp->alias);
 		break;
 
+	case ACT_RENAME2:
+		r = dm_rename(mpp->alias_old, mpp->alias);
+		if (r) {
+			r = dm_addmap_reload(mpp, params);
+			if (r)
+				r = dm_simplecmd_noflush(DM_DEVICE_RESUME, mpp->alias, MPATH_UDEV_RELOAD_FLAG);
+		}
+		break;
+
 	default:
 		break;
 	}
Index: multipath-tools-130222/libmultipath/configure.h
===================================================================
--- multipath-tools-130222.orig/libmultipath/configure.h
+++ multipath-tools-130222/libmultipath/configure.h
@@ -18,6 +18,7 @@ enum actions {
 	ACT_RENAME,
 	ACT_CREATE,
 	ACT_RESIZE,
+	ACT_RENAME2,
 };
 
 #define FLUSH_ONE 1
Index: multipath-tools-130222/libmultipath/devmapper.c
===================================================================
--- multipath-tools-130222.orig/libmultipath/devmapper.c
+++ multipath-tools-130222/libmultipath/devmapper.c
@@ -565,10 +565,9 @@ dm_dev_t (const char * mapname, char * d
 	if (!dm_task_run(dmt))
 		goto out;
 
-	if (!dm_task_get_info(dmt, &info))
+	if (!dm_task_get_info(dmt, &info) || !info.exists)
 		goto out;
 
-	r = info.open_count;
 	if (snprintf(dev_t, len, "%i:%i", info.major, info.minor) > len)
 		    goto out;