Blob Blame History Raw
---
 libmultipath/configure.c |   11 +++++++++++
 libmultipath/configure.h |    1 +
 libmultipath/devmapper.c |    3 +--
 3 files changed, 13 insertions(+), 2 deletions(-)

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