diff options
author | jeff <jeff@FreeBSD.org> | 2005-02-23 00:11:14 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2005-02-23 00:11:14 +0000 |
commit | cd66df18cccbb54d9499965f62bdb5ffab891dae (patch) | |
tree | 15b8eca0468fc559d607541d2292663bacdddd80 /sys/kern/vfs_subr.c | |
parent | 0d71606b28f40348cf50e0975609ef1438285b64 (diff) | |
download | FreeBSD-src-cd66df18cccbb54d9499965f62bdb5ffab891dae.zip FreeBSD-src-cd66df18cccbb54d9499965f62bdb5ffab891dae.tar.gz |
- Only the xlock holder should be calling VOP_LOCK on a vp once VI_XLOCK
has been set. Assert that this is the case so that we catch filesystems
who are using naked VOP_LOCKs in illegal cases.
Sponsored by: Isilon Systems, Inc.
Diffstat (limited to 'sys/kern/vfs_subr.c')
-rw-r--r-- | sys/kern/vfs_subr.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 0a8b352..053c385 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -3511,6 +3511,11 @@ vop_lock_pre(void *ap) { struct vop_lock_args *a = ap; + if (a->a_vp->v_iflag & VI_XLOCK && + a->a_vp->v_vxthread != curthread) { + vprint("vop_lock_pre:", a->a_vp); + panic("vop_lock_pre: locked while xlock held.\n"); + } if ((a->a_flags & LK_INTERLOCK) == 0) ASSERT_VI_UNLOCKED(a->a_vp, "VOP_LOCK"); else |