Skip to contentSkip to conversation

osm_ucast_ftree.c: replace assert with error return value

PATCH New Hal Rosenstock 1 participant 1 message Dec 30, 2013 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 osm_ucast_ftree.c: replace assert with error return value

From: Daniel Klein <danielk-VPRAkNaXOzVWk0Htik3J/[email protected]>

Removed assert in fabric_create_leaf_switch_array() that checks that the number of leafs is > 1. Instead the function returns -1, which fails the routing engine.

---
 opensm/osm_ucast_ftree.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
opensm/osm_ucast_ftree.c +8 -1
index 581c233..4cec0ae 100644
@@ -1719,12 +1719,19 @@ static int fabric_create_leaf_switch_array(IN ftree_fabric_t * p_ftree)
 			last_leaf_idx = i;
 		}
 	}
-	CL_ASSERT(first_leaf_idx < last_leaf_idx);
 
 	OSM_LOG(&p_ftree->p_osm->log, OSM_LOG_DEBUG,
 		"Full leaf array info: first_leaf_idx = %u, last_leaf_idx = %u\n",
 		first_leaf_idx, last_leaf_idx);
 
+	if (first_leaf_idx >= last_leaf_idx) {
+		osm_log_v2(&p_ftree->p_osm->log, OSM_LOG_INFO, FILE_ID,
+			   "Faild to find leaf switches - topology is not "
+			   "fat-tree\n");
+		res = -1;
+		goto Exit;
+	}
+
 	/* Create array of REAL leaf switches, sorted by index.
 	   This array may contain switches at the same rank w/o CNs,
 	   in case this is the order of indexing. */
Signature · 6 lines
1.7.8.2

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html