From owner-freebsd-hackers Sun Jan 5 10:49: 1 2003 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A63C437B401; Sun, 5 Jan 2003 10:48:59 -0800 (PST) Received: from mailout03.sul.t-online.com (mailout03.sul.t-online.com [194.25.134.81]) by mx1.FreeBSD.org (Postfix) with ESMTP id EC97E43ED1; Sun, 5 Jan 2003 10:48:58 -0800 (PST) (envelope-from se@FreeBSD.org) Received: from fwd02.sul.t-online.de by mailout03.sul.t-online.com with smtp id 18VFpR-0001vb-0A; Sun, 05 Jan 2003 19:48:57 +0100 Received: from Gatekeeper.FreeBSD.org (520047440004-0001@[217.81.11.225]) by fmrl02.sul.t-online.com with esmtp id 18VFpO-16myYKC; Sun, 5 Jan 2003 19:48:54 +0100 Received: from StefanEsser.FreeBSD.org (StefanEsser [10.0.0.1]) by Gatekeeper.FreeBSD.org (Postfix) with ESMTP id 9D3AF5F1C; Sun, 5 Jan 2003 19:48:53 +0100 (CET) Received: by StefanEsser.FreeBSD.org (Postfix, from userid 200) id 84F7B161F; Sun, 5 Jan 2003 19:48:53 +0100 (CET) Date: Sun, 5 Jan 2003 19:48:53 +0100 From: Stefan Esser To: hackers@FreeBSD.org Subject: [Patch] Incomplete vnode lock checking (DEBUG_VFS_LOCKS) Message-ID: <20030105184853.GB9274@StefanEsser.FreeBSD.org> Mail-Followup-To: Stefan Esser , hackers@FreeBSD.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.1i X-Sender: 520047440004-0001@t-dialin.net Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG When /sys/tools/vnode_if.awk creates vnode_if.c from a template, it does never check the lock state of **vpp. (This is the indirect result of the double indirection required to store the vnode pointer as a side-effect of the function.) The following simple patch fixes vnode_if.awk: Index: /sys/tools/vnode_if.awk =================================================================== RCS file: /usr/cvs/src/sys/tools/vnode_if.awk,v retrieving revision 1.37 diff -u -r1.37 vnode_if.awk --- /sys/tools/vnode_if.awk 26 Sep 2002 04:48:43 -0000 1.37 +++ /sys/tools/vnode_if.awk 31 Dec 2002 13:37:20 -0000 @@ -65,6 +65,8 @@ function add_debug_code(name, arg, pos) { + if (arg == "vpp") + arg = "*vpp"; if (lockdata[name, arg, pos]) { printh("\tASSERT_VI_UNLOCKED("arg", \""uname"\");"); # Add assertions for locking (An alternative fix would be to specify locking for vpp in the form "#% *vpp L L L" instead of "#% vpp L L L". This requires a small change to the regular expression in line 171 (permit optional leading "*" for $2) and the removal of the name mangling in line 174f ...) Any objections against me commiting the proposed patch ? Regards, STefan To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message