Date: Sun, 5 Jan 2003 19:48:53 +0100 From: Stefan Esser <se@freebsd.org> To: hackers@FreeBSD.org Subject: [Patch] Incomplete vnode lock checking (DEBUG_VFS_LOCKS) Message-ID: <20030105184853.GB9274@StefanEsser.FreeBSD.org>
index | next in thread | raw e-mail
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
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030105184853.GB9274>
