From e1cb2941d4424de90eb68716d6c4d95f4c0af0ba Mon Sep 17 00:00:00 2001 From: kib Date: Wed, 10 Jun 2009 20:59:32 +0000 Subject: Adapt vfs kqfilter to the shared vnode lock used by zfs write vop. Use vnode interlock to protect the knote fields [1]. The locking assumes that shared vnode lock is held, thus we get exclusive access to knote either by exclusive vnode lock protection, or by shared vnode lock + vnode interlock. Do not use kl_locked() method to assert either lock ownership or the fact that curthread does not own the lock. For shared locks, ownership is not recorded, e.g. VOP_ISLOCKED can return LK_SHARED for the shared lock not owned by curthread, causing false positives in kqueue subsystem assertions about knlist lock. Remove kl_locked method from knlist lock vector, and add two separate assertion methods kl_assert_locked and kl_assert_unlocked, that are supposed to use proper asserts. Change knlist_init accordingly. Add convenience function knlist_init_mtx to reduce number of arguments for typical knlist initialization. Submitted by: jhb [1] Noted by: jhb [2] Reviewed by: jhb Tested by: rnoland --- sys/net/if_tap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sys/net/if_tap.c') diff --git a/sys/net/if_tap.c b/sys/net/if_tap.c index 9256301..6668d94 100644 --- a/sys/net/if_tap.c +++ b/sys/net/if_tap.c @@ -462,7 +462,7 @@ tapcreate(struct cdev *dev) tp->tap_flags |= TAP_INITED; mtx_unlock(&tp->tap_mtx); - knlist_init(&tp->tap_rsel.si_note, NULL, NULL, NULL, NULL); + knlist_init_mtx(&tp->tap_rsel.si_note, NULL); TAPDEBUG("interface %s is created. minor = %#x\n", ifp->if_xname, dev2unit(dev)); -- cgit v1.1