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

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