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

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