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

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