From owner-svn-src-head@freebsd.org Tue Apr 24 18:41:15 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 065D5FAF2F4; Tue, 24 Apr 2018 18:41:15 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B0346700C6; Tue, 24 Apr 2018 18:41:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AB34E16DDC; Tue, 24 Apr 2018 18:41:14 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3OIfEbB074132; Tue, 24 Apr 2018 18:41:14 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3OIfE0U074131; Tue, 24 Apr 2018 18:41:14 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201804241841.w3OIfE0U074131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Tue, 24 Apr 2018 18:41:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332957 - head/sys/kern X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: head/sys/kern X-SVN-Commit-Revision: 332957 X-SVN-Commit-Repository: base 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.25 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: Tue, 24 Apr 2018 18:41:15 -0000 Author: cem Date: Tue Apr 24 18:41:14 2018 New Revision: 332957 URL: https://svnweb.freebsd.org/changeset/base/332957 Log: lockmgr: Add missed neutering during panic r313683 introduced new lockmgr APIs that missed the panic-time neutering present in the rest of our locks. Correct that by adding the usual check. Additionally, move the __lockmgr_args neutering above the assertions at the top of the function. Drop the interlock unlock because we shouldn't have an unneutered interlock either. No point trying to unlock it. PR: 227749 Reported by: jtl Sponsored by: Dell EMC Isilon Modified: head/sys/kern/kern_lock.c Modified: head/sys/kern/kern_lock.c ============================================================================== --- head/sys/kern/kern_lock.c Tue Apr 24 18:19:30 2018 (r332956) +++ head/sys/kern/kern_lock.c Tue Apr 24 18:41:14 2018 (r332957) @@ -918,6 +918,9 @@ lockmgr_lock_fast_path(struct lock *lk, u_int flags, s u_int op; bool locked; + if (__predict_false(panicstr != NULL)) + return (0); + op = flags & LK_TYPE_MASK; locked = false; switch (op) { @@ -1100,6 +1103,9 @@ lockmgr_unlock_fast_path(struct lock *lk, u_int flags, const char *file; int line; + if (__predict_false(panicstr != NULL)) + return (0); + file = __FILE__; line = __LINE__; @@ -1146,6 +1152,9 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lo int contested = 0; #endif + if (panicstr != NULL) + return (0); + error = 0; tid = (uintptr_t)curthread; op = (flags & LK_TYPE_MASK); @@ -1172,11 +1181,6 @@ __lockmgr_args(struct lock *lk, u_int flags, struct lo lk->lock_object.lo_name, file, line)); class = (flags & LK_INTERLOCK) ? LOCK_CLASS(ilk) : NULL; - if (panicstr != NULL) { - if (flags & LK_INTERLOCK) - class->lc_unlock(ilk); - return (0); - } if (lk->lock_object.lo_flags & LK_NOSHARE) { switch (op) {