Blame SOURCES/0149-RHBZ-1292599-restore-removed-parts.patch

4728c8
---
4728c8
 libmultipath/configure.c |    8 ++++++--
4728c8
 libmultipath/structs.h   |    1 +
4728c8
 multipathd/main.c        |    1 +
4728c8
 3 files changed, 8 insertions(+), 2 deletions(-)
4728c8
4728c8
Index: multipath-tools-130222/libmultipath/configure.c
4728c8
===================================================================
4728c8
--- multipath-tools-130222.orig/libmultipath/configure.c
4728c8
+++ multipath-tools-130222/libmultipath/configure.c
4728c8
@@ -398,6 +398,7 @@ select_action (struct multipath * mpp, v
4728c8
 				cmpp->alias, mpp->alias);
4728c8
 			strncpy(mpp->alias_old, cmpp->alias, WWID_SIZE);
4728c8
 			mpp->action = ACT_RENAME;
4728c8
+			mpp->force_udev_reload = force_reload;
4728c8
 			if (force_reload)
4728c8
 				mpp->action = ACT_RENAME2;
4728c8
 			return;
4728c8
@@ -437,11 +438,13 @@ select_action (struct multipath * mpp, v
4728c8
 		return;
4728c8
 	}
4728c8
 	if (force_reload) {
4728c8
+		mpp->force_udev_reload = 1;
4728c8
 		mpp->action = ACT_RELOAD;
4728c8
 		condlog(3, "%s: set ACT_RELOAD (forced by user)",
4728c8
 			mpp->alias);
4728c8
 		return;
4728c8
 	}
4728c8
+	mpp->force_udev_reload = !pathcount(mpp, PATH_WILD);
4728c8
 	if (cmpp->size != mpp->size) {
4728c8
 		mpp->action = ACT_RESIZE;
4728c8
 		condlog(3, "%s: set ACT_RESIZE (size change)",
4728c8
@@ -651,7 +654,7 @@ domap (struct multipath * mpp, char * pa
4728c8
 	case ACT_RELOAD:
4728c8
 		r = dm_addmap_reload(mpp, params);
4728c8
 		if (r)
4728c8
-			r = dm_simplecmd_noflush(DM_DEVICE_RESUME, mpp->alias, MPATH_UDEV_RELOAD_FLAG);
4728c8
+			r = dm_simplecmd_noflush(DM_DEVICE_RESUME, mpp->alias, (mpp->force_udev_reload)? 0 : MPATH_UDEV_RELOAD_FLAG);
4728c8
 		break;
4728c8
 
4728c8
 	case ACT_RESIZE:
4728c8
@@ -669,7 +672,7 @@ domap (struct multipath * mpp, char * pa
4728c8
 		if (r) {
4728c8
 			r = dm_addmap_reload(mpp, params);
4728c8
 			if (r)
4728c8
-				r = dm_simplecmd_noflush(DM_DEVICE_RESUME, mpp->alias, MPATH_UDEV_RELOAD_FLAG);
4728c8
+				r = dm_simplecmd_noflush(DM_DEVICE_RESUME, mpp->alias, (mpp->force_udev_reload)? 0 : MPATH_UDEV_RELOAD_FLAG);
4728c8
 		}
4728c8
 		break;
4728c8
 
4728c8
@@ -682,6 +685,7 @@ domap (struct multipath * mpp, char * pa
4728c8
 		 * DM_DEVICE_CREATE, DM_DEVICE_RENAME, or DM_DEVICE_RELOAD
4728c8
 		 * succeeded
4728c8
 		 */
4728c8
+		mpp->force_udev_reload = 0;
4728c8
 		if (mpp->action == ACT_CREATE) {
4728c8
 			if (remember_wwid(mpp->wwid) == 1)
4728c8
 				trigger_uevents(mpp);
4728c8
Index: multipath-tools-130222/libmultipath/structs.h
4728c8
===================================================================
4728c8
--- multipath-tools-130222.orig/libmultipath/structs.h
4728c8
+++ multipath-tools-130222/libmultipath/structs.h
4728c8
@@ -234,6 +234,7 @@ struct multipath {
4728c8
 	int deferred_remove;
4728c8
 	int delay_watch_checks;
4728c8
 	int delay_wait_checks;
4728c8
+	int force_udev_reload;
4728c8
 	unsigned int dev_loss;
4728c8
 	uid_t uid;
4728c8
 	gid_t gid;
4728c8
Index: multipath-tools-130222/multipathd/main.c
4728c8
===================================================================
4728c8
--- multipath-tools-130222.orig/multipathd/main.c
4728c8
+++ multipath-tools-130222/multipathd/main.c
4728c8
@@ -554,6 +554,7 @@ rescan:
4728c8
 
4728c8
 		condlog(4,"%s: adopting all paths for path %s",
4728c8
 			mpp->alias, pp->dev);
4728c8
+		mpp->force_udev_reload = !pathcount(mpp, PATH_WILD);
4728c8
 		if (adopt_paths(vecs->pathvec, mpp, 1))
4728c8
 			goto fail; /* leave path added to pathvec */
4728c8