diff mbox

[PATCHv2] infiniband-diags/ibqueryerrors.c: changed the behavior when guid/DR-path not found

Message ID 20130220123600.GD20018@r-ufm5-17.lab.mtl.com (mailing list archive)
State Rejected, archived
Delegated to: Ira Weiny
Headers show

Commit Message

Dan Ben Yosef Feb. 20, 2013, 12:36 p.m. UTC
If we use G or D options and we can't find the guid (sm is down or the
guid is wrong), we'll get an error instead of the result for all the
ports in the fabric.

Signed-off-by: Dan Ben Yosef <danby@mellanox.com>
---
Changes since v1:
	Fixed patch description

 src/ibqueryerrors.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)
diff mbox

Patch

diff --git a/src/ibqueryerrors.c b/src/ibqueryerrors.c
index 076327c..6320972 100644
--- a/src/ibqueryerrors.c
+++ b/src/ibqueryerrors.c
@@ -935,16 +935,18 @@  int main(int argc, char **argv)
 	if (dr_path) {
 		if ((resolved =
 		     resolve_portid_str(ibd_ca, ibd_ca_port, &portid, dr_path,
-					IB_DEST_DRPATH, NULL, ibmad_port)) < 0)
-			IBWARN("Failed to resolve %s; attempting full scan",
-			       dr_path);
+					IB_DEST_DRPATH, NULL, ibmad_port)) < 0) {
+			IBWARN("Failed to resolve %s;",dr_path);
+			goto close_port;
+		}
 	} else if (port_guid_str) {
 		if ((resolved =
 		     resolve_portid_str(ibd_ca, ibd_ca_port, &portid,
 					port_guid_str, IB_DEST_GUID, ibd_sm_id,
-					       ibmad_port)) < 0)
-			IBWARN("Failed to resolve %s; attempting full scan",
-			       port_guid_str);
+					       ibmad_port)) < 0) {
+			IBWARN("Failed to resolve %s;",port_guid_str);
+			goto close_port;
+		}
 	}
 
 	if (load_cache_file) {