From owner-svn-src-head@FreeBSD.ORG Mon Jun 3 17:38:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 54E36C1E; Mon, 3 Jun 2013 17:38:58 +0000 (UTC) (envelope-from jhb@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 47A821C75; Mon, 3 Jun 2013 17:38:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r53HcwCe093884; Mon, 3 Jun 2013 17:38:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r53Hcw3M093883; Mon, 3 Jun 2013 17:38:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201306031738.r53Hcw3M093883@svn.freebsd.org> From: John Baldwin Date: Mon, 3 Jun 2013 17:38:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r251323 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Jun 2013 17:38:58 -0000 Author: jhb Date: Mon Jun 3 17:38:57 2013 New Revision: 251323 URL: http://svnweb.freebsd.org/changeset/base/251323 Log: - Handle the recursed/not recursed flags with RA_RLOCKED in rw_assert(). - Tweak a panic message. Modified: head/sys/kern/kern_rwlock.c Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Mon Jun 3 17:36:43 2013 (r251322) +++ head/sys/kern/kern_rwlock.c Mon Jun 3 17:38:57 2013 (r251323) @@ -371,7 +371,7 @@ __rw_rlock(volatile uintptr_t *c, const KASSERT(rw->rw_lock != RW_DESTROYED, ("rw_rlock() of destroyed rwlock @ %s:%d", file, line)); KASSERT(rw_wowner(rw) != curthread, - ("%s (%s): wlock already held @ %s:%d", __func__, + ("rw_rlock: wlock already held for %s @ %s:%d", rw->lock_object.lo_name, file, line)); WITNESS_CHECKORDER(&rw->lock_object, LOP_NEWORDER, file, line, NULL); @@ -1124,6 +1124,8 @@ __rw_assert(const volatile uintptr_t *c, case RA_LOCKED | RA_RECURSED: case RA_LOCKED | RA_NOTRECURSED: case RA_RLOCKED: + case RA_RLOCKED | RA_RECURSED: + case RA_RLOCKED | RA_NOTRECURSED: #ifdef WITNESS witness_assert(&rw->lock_object, what, file, line); #else @@ -1133,13 +1135,13 @@ __rw_assert(const volatile uintptr_t *c, * has a lock at all, fail. */ if (rw->rw_lock == RW_UNLOCKED || - (!(rw->rw_lock & RW_LOCK_READ) && (what == RA_RLOCKED || + (!(rw->rw_lock & RW_LOCK_READ) && (what & RA_RLOCKED || rw_wowner(rw) != curthread))) panic("Lock %s not %slocked @ %s:%d\n", - rw->lock_object.lo_name, (what == RA_RLOCKED) ? + rw->lock_object.lo_name, (what & RA_RLOCKED) ? "read " : "", file, line); - if (!(rw->rw_lock & RW_LOCK_READ)) { + if (!(rw->rw_lock & RW_LOCK_READ) && !(what & RA_RLOCKED)) { if (rw_recursed(rw)) { if (what & RA_NOTRECURSED) panic("Lock %s recursed @ %s:%d\n",