Blame SOURCES/0092-UPBZ-1104605-reload-on-rename.patch

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