Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 31 Dec 2002 14:52:27 +0100 (CET)
From:      Stefan Esser <se@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/46652: DEBUG_VFS_LOCKS never checks locks for **vpp
Message-ID:  <20021231135227.84B861550@StefanEsser.FreeBSD.org>

next in thread | raw e-mail | index | archive | help

>Number:         46652
>Category:       kern
>Synopsis:       DEBUG_VFS_LOCKS never checks locks for **vpp
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Dec 31 07:20:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Stefan Esser
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD StefanEsser.FreeBSD.org 5.0-CURRENT FreeBSD 5.0-CURRENT #11: Sun Dec 29 19:23:53 CET 2002 root@:/usr/src/sys/i386/compile/ISDN686 i386


	
>Description:
There is an inconsistency in "/sys/tools/vnode_if.awk", which causes VOP 
locking assertions to be missed for one specific argument name:

No assertions are ever generated for VOP argument **vpp, since that 
argument name is mangled into "*vpp" when reading the locking requirements,
but not when generating the test macros in "add_debug_code".
>How-To-Repeat:
Have a look at the generated "vnode_if.h" in the kernel build directory.
There are no assertions for "vpp", though locking is specified for that 
argument in vnode_if.src.
>Fix:
The minimal patch (requires no changes to vnode_if.src) follows:

Apply the following simple patch to /sys/tools/vnode_if.awk in order
to match the mangled name when generating debug code:

Index: /sys/tools/vnode_if.awk
===================================================================
RCS file: /usr/cvs/src/sys/tools/vnode_if.awk,v
retrieving revision 1.37
diff -u -3 -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 ...)
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021231135227.84B861550>