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