From patchwork Wed Apr 14 22:48:01 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Chu X-Patchwork-Id: 92507 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3EMlp40000736 for ; Wed, 14 Apr 2010 22:48:04 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756106Ab0DNWsC (ORCPT ); Wed, 14 Apr 2010 18:48:02 -0400 Received: from nspiron-3.llnl.gov ([128.115.41.83]:19767 "EHLO smtp.llnl.gov" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755166Ab0DNWsB (ORCPT ); Wed, 14 Apr 2010 18:48:01 -0400 X-Attachments: 0002-check-for-duplicate-port-guids-in-libibnetdisc-cache.patch Received: from auk31.llnl.gov (HELO [134.9.93.159]) ([134.9.93.159]) by smtp.llnl.gov with ESMTP; 14 Apr 2010 15:48:01 -0700 Subject: [infiniband-diags] [2/2] check for duplicate port guids in libibnetdisc cache From: Al Chu To: Sasha Khapyorsky Cc: "linux-rdma@vger.kernel.org" Date: Wed, 14 Apr 2010 15:48:01 -0700 Message-Id: <1271285281.17987.140.camel@auk31.llnl.gov> Mime-Version: 1.0 X-Mailer: Evolution 2.12.3 (2.12.3-19.el5) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 14 Apr 2010 22:48:04 +0000 (UTC) diff --git a/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c b/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c index 2ec353d..a02fcba 100644 --- a/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c +++ b/infiniband-diags/libibnetdisc/src/ibnetdisc_cache.c @@ -505,6 +505,11 @@ static int _fill_port(ibnd_fabric_cache_t * fabric_cache, ibnd_node_t * node, return -1; } + if (port_cache->port_stored_to_fabric) { + IBND_DEBUG("Cache invalid: duplicate port discovered\n"); + return -1; + } + node->ports[port_cache->port->portnum] = port_cache->port; port_cache->port_stored_to_fabric++;