From 27ad03cb5de878b174a1e02c472ef90629ba9ea5 Mon Sep 17 00:00:00 2001 From: Jeff Roberson Date: Mon, 28 Mar 2005 09:31:57 +0000 Subject: [PATCH] - We no longer have to bother with PDIRUNLOCK, lookup() handles it for us. - In the ISDOTDOT case we have to unlock the dvp before locking the child, if this fails we must relock dvp before returning an error. This was missing before. Sponsored by: Isilon Systems, Inc. --- sys/fs/udf/udf_vnops.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/fs/udf/udf_vnops.c b/sys/fs/udf/udf_vnops.c index 00d1b71b0189..c7ff99a440b3 100644 --- a/sys/fs/udf/udf_vnops.c +++ b/sys/fs/udf/udf_vnops.c @@ -911,6 +911,8 @@ udf_lookup(struct vop_cachedlookup_args *a) /* Did we have a match? */ if (id) { + if (flags & ISDOTDOT) + VOP_UNLOCK(dvp, 0, a->a_cnp->cn_thread); error = udf_vget(udfmp->im_mountp, id, LK_EXCLUSIVE, &tdp); if (!error) { /* @@ -921,17 +923,13 @@ udf_lookup(struct vop_cachedlookup_args *a) node->diroff = ds->offset + ds->off; if (numdirpasses == 2) nchstats.ncs_pass2++; - if (!(flags & LOCKPARENT) || !(flags & ISLASTCN)) { - a->a_cnp->cn_flags |= PDIRUNLOCK; - VOP_UNLOCK(dvp, 0, td); - } - *vpp = tdp; - /* Put this entry in the cache */ if (flags & MAKEENTRY) cache_enter(dvp, *vpp, a->a_cnp); - } + } else if (flags & ISDOTDOT) + vn_lock(dvp, LK_EXCLUSIVE|LK_RETRY, + a->a_cnp->cn_thread); } else { /* Name wasn't found on this pass. Do another pass? */ if (numdirpasses == 2) {