From nobody Tue Apr 11 13:20:56 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PwmgY27xVz44rh3; Tue, 11 Apr 2023 13:20:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PwmgY0spLz3rSD; Tue, 11 Apr 2023 13:20:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681219257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CGxEnsFCQ0K53qZdVxjMOA7YAZXeNp6lpC18s8uKJtY=; b=Tx3p3oWpGuh3MfB155jCH1Ya80P5ZAvYMtmOT/3tOT0DDdRz8id8EosdqdfQ7bI3BikZ7n j5tLAVMjFp8DzzRjTt4Fgp1jBHc6fQTEviDsQE9jL7e6dYhcyqanCMoOgiNpJ/nMGMVMMv 7XXrrWVCV3BhaCpMIpKwoOHeBPtH/3Kb7U89VWWsrABCAGlwG/Z8PzTRddMqOq/C6eGauz YD/AROHK5IUDLNCUZl2Jgj/BVRqZqssfLJVtwXwJLKLnolD+KKltE7YQHzy7I4wqiZPGLF 1h0ANk3mlJ4VkViV9ryQBeYXDyV+clYqO1Y1XmwWXNGu/KoT3BXAjXQAfw4uvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681219257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=CGxEnsFCQ0K53qZdVxjMOA7YAZXeNp6lpC18s8uKJtY=; b=HBGGzt4a8Jp8ELOTwan9Q5MWdxsxgRAfnKDg2ma2yCvvszTBu8m9IoBgAQxBruavNlo32G NTA8D1lEEIKL7KEthT13jb3KKvJZt2ZUI1Hv66LLYs95CfhOMiHsGDEtV6zYJCr6hQDJ3X abFZczFvVdzevxXlAYTv5c9A/7GQ35Z3ISdK7b+Yat1Qiw4jyn8oBSKgDyWgLU6Xc7JUAZ ijGBBFl6SHHdeIz80PTonJgsXpB2xbN9qaIkNMmHxZXeUR+y5zb1RkpUQySGIkwv4vlOzd LPYevsMkg/y4kuUVUdEGTSpeIPPkCYJlbX5bbtPUzjDvH0uhrLPTZfRoQHE7iw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681219257; a=rsa-sha256; cv=none; b=OOiu90471K8mJtGYn/gUqyvEvSoznbPYFLyVEWJ86UXdC0ggp5pFSpI6TYjSN9dSE9HGKy sTr8cC3oX4Y2XRm0iIl9zbsXENxdY3RZvgHLBIwpna5yk1Ioo9aujDE0zpVYyUC56QtKbY gsXYMHQOLcfdIcjLJjddLsdeeYtJPGRfDTa2vv+H6+l2FNXo8mSVfFmwxYt+GDsT3I7HjB 0iUJBp3CsgOJ0bTBvVMx8pGZN4kcjdRvFgsq2FjmyQChTZefu1tWXUtMBdl+efruQkJX/i waN9EYOdDoaVEr4Q6SqgQ43ENvtOFa0+iRUMCAeAoa2Wd8kZ0CGBIkgKd1xgWg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PwmgX6wfRzK5X; Tue, 11 Apr 2023 13:20:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33BDKug8010270; Tue, 11 Apr 2023 13:20:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33BDKuZO010269; Tue, 11 Apr 2023 13:20:56 GMT (envelope-from git) Date: Tue, 11 Apr 2023 13:20:56 GMT Message-Id: <202304111320.33BDKuZO010269@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: c53e990b8d04 - main - DEBUG_VFS_LOCKS: restore diagnostic for the witness use case List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c53e990b8d0444b5ad59ddb18742a71434e30ee2 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c53e990b8d0444b5ad59ddb18742a71434e30ee2 commit c53e990b8d0444b5ad59ddb18742a71434e30ee2 Author: Konstantin Belousov AuthorDate: 2023-04-10 08:52:43 +0000 Commit: Konstantin Belousov CommitDate: 2023-04-11 12:59:55 +0000 DEBUG_VFS_LOCKS: restore diagnostic for the witness use case Reviewed by: jah, markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D39477 --- sys/kern/vfs_subr.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 7e7315f827a1..60d3a71667a1 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -5456,14 +5456,13 @@ assert_vop_locked(struct vnode *vp, const char *str) return; #ifdef WITNESS - if ((vp->v_irflag & VIRF_CROSSMP) == 0) - witness_assert(&vp->v_vnlock->lock_object, LA_LOCKED, - __FILE__, __LINE__); + if ((vp->v_irflag & VIRF_CROSSMP) == 0 && + witness_is_owned(&vp->v_vnlock->lock_object) == -1) #else int locked = VOP_ISLOCKED(vp); if (locked == 0 || locked == LK_EXCLOTHER) - vfs_badlock("is not locked but should be", str, vp); #endif + vfs_badlock("is not locked but should be", str, vp); } void @@ -5473,13 +5472,12 @@ assert_vop_unlocked(struct vnode *vp, const char *str) return; #ifdef WITNESS - if ((vp->v_irflag & VIRF_CROSSMP) == 0) - witness_assert(&vp->v_vnlock->lock_object, LA_UNLOCKED, - __FILE__, __LINE__); + if ((vp->v_irflag & VIRF_CROSSMP) == 0 && + witness_is_owned(&vp->v_vnlock->lock_object) == 1) #else if (VOP_ISLOCKED(vp) == LK_EXCLUSIVE) - vfs_badlock("is locked but should not be", str, vp); #endif + vfs_badlock("is locked but should not be", str, vp); } void