From patchwork Sat May 21 14:56:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hal Rosenstock X-Patchwork-Id: 805902 X-Patchwork-Delegate: alexne@voltaire.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.3) with ESMTP id p4LEufcU004388 for ; Sat, 21 May 2011 14:56:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753218Ab1EUO4g (ORCPT ); Sat, 21 May 2011 10:56:36 -0400 Received: from mail-wy0-f174.google.com ([74.125.82.174]:63273 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752655Ab1EUO4g (ORCPT ); Sat, 21 May 2011 10:56:36 -0400 Received: by wya21 with SMTP id 21so3305809wya.19 for ; Sat, 21 May 2011 07:56:30 -0700 (PDT) Received: by 10.227.108.233 with SMTP id g41mr670067wbp.22.1305989790475; Sat, 21 May 2011 07:56:30 -0700 (PDT) Received: from [192.168.1.103] (c-71-192-10-85.hsd1.ma.comcast.net [71.192.10.85]) by mx.google.com with ESMTPS id w12sm2925460wby.58.2011.05.21.07.56.28 (version=SSLv3 cipher=OTHER); Sat, 21 May 2011 07:56:29 -0700 (PDT) Message-ID: <4DD7D29A.3030206@dev.mellanox.co.il> Date: Sat, 21 May 2011 10:56:26 -0400 From: Hal Rosenstock User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 MIME-Version: 1.0 To: Alex Netes CC: "linux-rdma@vger.kernel.org" Subject: [PATCH 14/13] opensm/osm_sa_guidinfo_record.c: Fix locking 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.6 (demeter2.kernel.org [140.211.167.43]); Sat, 21 May 2011 14:56:41 +0000 (UTC) Fix locking around set_guidinfo/del_guidinfo Found and fixed by: Alex Netes Signed-off-by: Hal Rosenstock --- -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/opensm/osm_sa_guidinfo_record.c b/opensm/osm_sa_guidinfo_record.c index c792943..a1bb166 100644 --- a/opensm/osm_sa_guidinfo_record.c +++ b/opensm/osm_sa_guidinfo_record.c @@ -737,10 +737,12 @@ void osm_gir_rcv_process(IN void *ctx, IN void *data) if (!osm_physp_share_pkey(sa->p_log, p_req_physp, p_port->p_physp)) goto Exit; + CL_PLOCK_EXCL_ACQUIRE(sa->p_lock); if (p_rcvd_mad->method == IB_MAD_METHOD_SET) set_guidinfo(sa, p_madw, p_port, p_rcvd_rec->block_num); else del_guidinfo(sa, p_madw, p_port, p_rcvd_rec->block_num); + CL_PLOCK_RELEASE(sa->p_lock); break; default: OSM_LOG(sa->p_log, OSM_LOG_ERROR, "ERR 5105: "