Blame SOURCES/0171-UPBZ-1356651-allow-zero-size.patch

c896fb
---
c896fb
 libmultipath/discovery.c   |    5 +++++
c896fb
 libmultipath/structs_vec.c |    2 +-
c896fb
 multipathd/main.c          |   26 +++++---------------------
c896fb
 3 files changed, 11 insertions(+), 22 deletions(-)
c896fb
c896fb
Index: multipath-tools-130222/libmultipath/discovery.c
c896fb
===================================================================
c896fb
--- multipath-tools-130222.orig/libmultipath/discovery.c
c896fb
+++ multipath-tools-130222/libmultipath/discovery.c
c896fb
@@ -1188,6 +1188,11 @@ pathinfo (struct path *pp, vector hwtabl
c896fb
 			if (pp->state == PATH_UNCHECKED ||
c896fb
 			    pp->state == PATH_WILD)
c896fb
 				goto blank;
c896fb
+			if (pp->state == PATH_UP && !pp->size) {
c896fb
+				condlog(3, "%s: device size is 0, "
c896fb
+					"path unuseable", pp->dev);
c896fb
+				pp->state = PATH_GHOST;
c896fb
+			}
c896fb
 		} else {
c896fb
 			condlog(3, "%s: path inaccessible", pp->dev);
c896fb
 			pp->chkrstate = pp->state = path_state;
c896fb
Index: multipath-tools-130222/libmultipath/structs_vec.c
c896fb
===================================================================
c896fb
--- multipath-tools-130222.orig/libmultipath/structs_vec.c
c896fb
+++ multipath-tools-130222/libmultipath/structs_vec.c
c896fb
@@ -551,7 +551,7 @@ int update_multipath (struct vectors *ve
c896fb
 
c896fb
 			if (pp->state != PATH_DOWN) {
c896fb
 				int oldstate = pp->state;
c896fb
-				condlog(2, "%s: mark as failed", pp->dev_t);
c896fb
+				condlog(2, "%s: mark as failed", pp->dev);
c896fb
 				mpp->stat_path_failures++;
c896fb
 				pp->state = PATH_DOWN;
c896fb
 				if (oldstate == PATH_UP ||
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
@@ -538,15 +538,10 @@ ev_add_path (struct path * pp, struct ve
c896fb
 	pp->mpp = mpp;
c896fb
 rescan:
c896fb
 	if (mpp) {
c896fb
-		if ((!pp->size) || (mpp->size != pp->size)) {
c896fb
-			if (!pp->size)
c896fb
-				condlog(0, "%s: failed to add new path %s, "
c896fb
-					"device size is 0",
c896fb
-					mpp->alias, pp->dev);
c896fb
-			else
c896fb
-				condlog(0, "%s: failed to add new path %s, "
c896fb
-					"device size mismatch",
c896fb
-					mpp->alias, pp->dev);
c896fb
+		if (pp->size && mpp->size != pp->size) {
c896fb
+			condlog(0, "%s: failed to add new path %s, "
c896fb
+				"device size mismatch",
c896fb
+				mpp->alias, pp->dev);
c896fb
 			int i = find_slot(vecs->pathvec, (void *)pp);
c896fb
 			if (i != -1)
c896fb
 				vector_del_slot(vecs->pathvec, i);
c896fb
@@ -563,18 +558,7 @@ rescan:
c896fb
 		verify_paths(mpp, vecs, NULL);
c896fb
 		mpp->flush_on_last_del = FLUSH_UNDEF;
c896fb
 		mpp->action = ACT_RELOAD;
c896fb
-	}
c896fb
-	else {
c896fb
-		if (!pp->size) {
c896fb
-			condlog(0, "%s: failed to create new map,"
c896fb
-				" device size is 0 ", pp->dev);
c896fb
-			int i = find_slot(vecs->pathvec, (void *)pp);
c896fb
-			if (i != -1)
c896fb
-				vector_del_slot(vecs->pathvec, i);
c896fb
-			free_path(pp);
c896fb
-			return 1;
c896fb
-		}
c896fb
-
c896fb
+	} else {
c896fb
 		if (!should_multipath(pp, vecs->pathvec)) {
c896fb
 			orphan_path(pp);
c896fb
 			return 0;