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

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