Index: vfs_cache.c =================================================================== RCS file: /usr/repo/src/sys/kern/vfs_cache.c,v retrieving revision 1.120 diff -u -p -r1.120 vfs_cache.c --- vfs_cache.c 31 Mar 2008 11:53:02 -0000 1.120 +++ vfs_cache.c 7 Apr 2008 14:14:36 -0000 @@ -423,7 +423,7 @@ success: * When we lookup "." we still can be asked to lock it * differently... */ - ltype = cnp->cn_lkflags & (LK_SHARED | LK_EXCLUSIVE); + ltype = cnp->cn_lkflags & LK_TYPE_MASK; if (ltype == VOP_ISLOCKED(*vpp)) return (-1); else if (ltype == LK_EXCLUSIVE) @@ -440,12 +440,14 @@ success: error = vget(*vpp, cnp->cn_lkflags | LK_INTERLOCK, cnp->cn_thread); if (cnp->cn_flags & ISDOTDOT) vn_lock(dvp, ltype | LK_RETRY); - if ((cnp->cn_flags & ISLASTCN) && (cnp->cn_lkflags & LK_EXCLUSIVE)) - ASSERT_VOP_ELOCKED(*vpp, "cache_lookup"); if (error) { *vpp = NULL; goto retry; } + if ((cnp->cn_flags & ISLASTCN) && + (cnp->cn_lkflags & LK_TYPE_MASK) == LK_EXCLUSIVE) { + ASSERT_VOP_ELOCKED(*vpp, "cache_lookup"); + } return (-1); }