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

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