From patchwork Mon Apr 26 13:02:25 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Khapyorsky X-Patchwork-Id: 95066 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 o3QD1w0f021585 for ; Mon, 26 Apr 2010 13:01:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753392Ab0DZNB5 (ORCPT ); Mon, 26 Apr 2010 09:01:57 -0400 Received: from fg-out-1718.google.com ([72.14.220.159]:32574 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750991Ab0DZNB4 (ORCPT ); Mon, 26 Apr 2010 09:01:56 -0400 Received: by fg-out-1718.google.com with SMTP id 19so2012310fgg.1 for ; Mon, 26 Apr 2010 06:01:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:received:date:from:to :cc:subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=fCuUbspOiZ/RgP2++w7Qjwp/fLkYSeF/rMcpsyS983A=; b=koaPNVBA9+SijirTd8Xj++uARyPBA5IuRimptoGX1Z62rTLLaHzGqzPoc0s5K9ynPD UYIRxHkhacPSrpIpiep2XbVvjUuCm0E9zHYDhJ4b/HIOHjjIZlVDYRpKn6rLAupfWq56 Ge/MPh4TdaXfmF8x9W8h71htgkNATJ5gLz9YU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=ijDmH1/fsjt9wxblvjGEPDPBqVM6+1QAJiaCVOLl74RKeAYJgawfv0ceaG5Fl3doP7 pVjLSbsLrA3b/EiJ9olYSQ6fEyUvB2AofPr5c/CsxOShwvcuLHgy5S45ydJJ2XQrw/nn prj5/B6jW8RUUGXG91UM3susdYcna1Xo0ede4= Received: by 10.87.64.25 with SMTP id r25mr1977141fgk.20.1272286911460; Mon, 26 Apr 2010 06:01:51 -0700 (PDT) Received: from me.localdomain (85.64.35.106.dynamic.barak-online.net [85.64.35.106]) by mx.google.com with ESMTPS id 12sm142369fks.20.2010.04.26.06.01.50 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 26 Apr 2010 06:01:50 -0700 (PDT) Received: by me.localdomain (Postfix, from userid 1000) id 27DE311DF7; Mon, 26 Apr 2010 16:02:25 +0300 (IDT) Date: Mon, 26 Apr 2010 16:02:25 +0300 From: Sasha Khapyorsky To: linux-rdma Cc: Eli Dorfman , Alex Netes Subject: [PATCH v2] opensm/osm_lid_mgr: fix couple of duplicate LIDs bugs Message-ID: <20100426130225.GY23994@me> References: <20100426104838.GS23994@me> <20100426121647.GU23994@me> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20100426121647.GU23994@me> User-Agent: Mutt/1.5.20 (2009-06-14) 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]); Mon, 26 Apr 2010 13:01:58 +0000 (UTC) diff --git a/opensm/opensm/osm_lid_mgr.c b/opensm/opensm/osm_lid_mgr.c index 84f3508..7da4eb0 100644 --- a/opensm/opensm/osm_lid_mgr.c +++ b/opensm/opensm/osm_lid_mgr.c @@ -306,11 +306,11 @@ static int lid_mgr_init_sweep(IN osm_lid_mgr_t * p_mgr) need to honor this file. */ if (p_mgr->p_subn->first_time_master_sweep == TRUE) { osm_db_clear(p_mgr->p_g2l); - if (p_mgr->p_subn->opt.honor_guid2lid_file == FALSE) { + memset(p_mgr->used_lids, 0, sizeof(p_mgr->used_lids)); + if (p_mgr->p_subn->opt.honor_guid2lid_file == FALSE) OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG, "Ignore guid2lid file when coming out of standby\n"); - memset(p_mgr->used_lids, 0, sizeof(p_mgr->used_lids)); - } else { + else { OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG, "Honor current guid2lid file when coming out " "of standby\n"); @@ -319,6 +319,7 @@ static int lid_mgr_init_sweep(IN osm_lid_mgr_t * p_mgr) "ERR 0306: " "Error restoring Guid-to-Lid " "persistent database. Ignoring it\n"); + lid_mgr_validate_db(p_mgr); } } @@ -710,7 +711,7 @@ static int lid_mgr_get_port_lid(IN osm_lid_mgr_t * p_mgr, /* we still need to send the setting to the target port */ lid_changed = 1; } - goto Exit; + goto NewLidSet; } else OSM_LOG(p_mgr->p_log, OSM_LOG_DEBUG, "0x%016" PRIx64 " has no persistent lid assigned\n", @@ -764,7 +765,6 @@ NewLidSet: for (lid = *p_min_lid; lid <= *p_max_lid; lid++) p_mgr->used_lids[lid] = 1; -Exit: /* make sure the assigned lids are marked in port_lid_tbl */ for (lid = *p_min_lid; lid <= *p_max_lid; lid++) cl_ptr_vector_set(&p_mgr->p_subn->port_lid_tbl, lid, p_port);