Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/ufs/ufs/ufs_rename.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/ufs/ufs/ufs_rename.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.10 retrieving revision 1.11 diff -u -p -r1.10 -r1.11 --- src/sys/ufs/ufs/ufs_rename.c 2014/02/06 10:57:12 1.10 +++ src/sys/ufs/ufs/ufs_rename.c 2014/05/25 13:45:39 1.11 @@ -1,4 +1,4 @@ -/* $NetBSD: ufs_rename.c,v 1.10 2014/02/06 10:57:12 hannken Exp $ */ +/* $NetBSD: ufs_rename.c,v 1.11 2014/05/25 13:45:39 hannken Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ufs_rename.c,v 1.10 2014/02/06 10:57:12 hannken Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ufs_rename.c,v 1.11 2014/05/25 13:45:39 hannken Exp $"); #include #include @@ -979,20 +979,15 @@ ufs_gro_genealogy(struct mount *mp, kaut } /* Neither -- keep ascending the family tree. */ - - /* - * Unlock vp so that we can lock the parent, but keep - * vp referenced until after we have found the parent, - * so that dotdot_ino will not be recycled. - * - * XXX This guarantees that vp's inode number will not - * be recycled, but why can't dotdot_ino be recycled? - */ - VOP_UNLOCK(vp); - error = VFS_VGET(mp, dotdot_ino, &dvp); - vrele(vp); + error = vcache_get(mp, &dotdot_ino, sizeof(dotdot_ino), &dvp); + vput(vp); if (error) return error; + error = vn_lock(dvp, LK_EXCLUSIVE); + if (error) { + vrele(dvp); + return error; + } KASSERT(dvp != NULL); KASSERT(VOP_ISLOCKED(dvp) == LK_EXCLUSIVE);