From owner-svn-src-all@FreeBSD.ORG Fri Dec 21 19:28:18 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 769EAD38; Fri, 21 Dec 2012 19:28:18 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5AFFD8FC13; Fri, 21 Dec 2012 19:28:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id qBLJSI87022157; Fri, 21 Dec 2012 19:28:18 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id qBLJSIJ1022156; Fri, 21 Dec 2012 19:28:18 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201212211928.qBLJSIJ1022156@svn.freebsd.org> From: Navdeep Parhar Date: Fri, 21 Dec 2012 19:28:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r244551 - head/sys/dev/cxgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Dec 2012 19:28:18 -0000 Author: np Date: Fri Dec 21 19:28:17 2012 New Revision: 244551 URL: http://svnweb.freebsd.org/changeset/base/244551 Log: cxgbe(4): must hold a write-lock on the table while allocating an L2 entry for switching. MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_l2t.c Modified: head/sys/dev/cxgbe/t4_l2t.c ============================================================================== --- head/sys/dev/cxgbe/t4_l2t.c Fri Dec 21 19:26:17 2012 (r244550) +++ head/sys/dev/cxgbe/t4_l2t.c Fri Dec 21 19:28:17 2012 (r244551) @@ -149,7 +149,7 @@ t4_l2t_alloc_switching(struct l2t_data * { struct l2t_entry *e; - rw_rlock(&d->lock); + rw_wlock(&d->lock); e = t4_alloc_l2e(d); if (e) { mtx_lock(&e->lock); /* avoid race with t4_l2t_free */ @@ -157,7 +157,7 @@ t4_l2t_alloc_switching(struct l2t_data * atomic_store_rel_int(&e->refcnt, 1); mtx_unlock(&e->lock); } - rw_runlock(&d->lock); + rw_wunlock(&d->lock); return e; }