aboutsummaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorMarcel Moolenaar <marcel@FreeBSD.org>2013-05-09 16:28:18 +0000
committerMarcel Moolenaar <marcel@FreeBSD.org>2013-05-09 16:28:18 +0000
commite63091ea6cec61bb108fd38131eae09d982feffa (patch)
tree535b854fe8328f0254c6ce52fdd275b2f12140ed /sys/kern
parenta28232e3039b6e2266179aced57a9f2a38aca034 (diff)
Notes
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_lock.c2
-rw-r--r--sys/kern/subr_witness.c14
-rw-r--r--sys/kern/vfs_subr.c2
3 files changed, 16 insertions, 2 deletions
diff --git a/sys/kern/kern_lock.c b/sys/kern/kern_lock.c
index 7962ae1a57ab..849f583cf23c 100644
--- a/sys/kern/kern_lock.c
+++ b/sys/kern/kern_lock.c
@@ -393,6 +393,8 @@ lockinit(struct lock *lk, int pri, const char *wmesg, int timo, int flags)
iflags |= LO_WITNESS;
if (flags & LK_QUIET)
iflags |= LO_QUIET;
+ if (flags & LK_IS_VNODE)
+ iflags |= LO_IS_VNODE;
iflags |= flags & (LK_ADAPTIVE | LK_NOSHARE);
lk->lk_lock = LK_UNLOCKED;
diff --git a/sys/kern/subr_witness.c b/sys/kern/subr_witness.c
index b30bf082ce1c..ac7636ae9203 100644
--- a/sys/kern/subr_witness.c
+++ b/sys/kern/subr_witness.c
@@ -1289,7 +1289,19 @@ witness_checkorder(struct lock_object *lock, int flags, const char *file,
w->w_reversed = w1->w_reversed = 1;
witness_increment_graph_generation();
mtx_unlock_spin(&w_mtx);
-
+
+#ifdef WITNESS_NO_VNODE
+ /*
+ * There are known LORs between VNODE locks. They are
+ * not an indication of a bug. VNODE locks are flagged
+ * as such (LO_IS_VNODE) and we don't yell if the LOR
+ * is between 2 VNODE locks.
+ */
+ if ((lock->lo_flags & LO_IS_VNODE) != 0 &&
+ (lock1->li_lock->lo_flags & LO_IS_VNODE) != 0)
+ return;
+#endif
+
/*
* Ok, yell about it.
*/
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index de118f7f3081..d9cbde2fbabc 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1037,7 +1037,7 @@ alloc:
* By default, don't allow shared locks unless filesystems
* opt-in.
*/
- lockinit(vp->v_vnlock, PVFS, tag, VLKTIMEOUT, LK_NOSHARE);
+ lockinit(vp->v_vnlock, PVFS, tag, VLKTIMEOUT, LK_NOSHARE | LK_IS_VNODE);
/*
* Initialize bufobj.
*/