From bf6ac110e048229e14a23ff1056c7ff8b4bec2d1 Mon Sep 17 00:00:00 2001 From: "Tim J. Robbins" Date: Sun, 16 Mar 2003 11:19:54 +0000 Subject: [PATCH] Make udf_allocv() return an unlocked vnode instead of a locked one to avoid a "locking against myself" panic when udf_hashins() tries to lock it again. Lock the vnode in udf_hashins() before adding it to the hash bucket. --- sys/fs/udf/udf_vnops.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/fs/udf/udf_vnops.c b/sys/fs/udf/udf_vnops.c index 6582f927b86..d48e36d202b 100644 --- a/sys/fs/udf/udf_vnops.c +++ b/sys/fs/udf/udf_vnops.c @@ -127,10 +127,10 @@ udf_hashins(struct udf_node *node) udfmp = node->udfmp; + vn_lock(node->i_vnode, LK_EXCLUSIVE | LK_RETRY, curthread); mtx_lock(&udfmp->hash_mtx); TAILQ_INSERT_TAIL(&udfmp->udf_tqh, node, tq); mtx_unlock(&udfmp->hash_mtx); - vn_lock(node->i_vnode, LK_EXCLUSIVE | LK_RETRY, curthread); return (0); } @@ -161,7 +161,6 @@ udf_allocv(struct mount *mp, struct vnode **vpp, struct thread *td) return (error); } - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY, td); *vpp = vp; return (0); }