Module Name:    src
Committed By:   dholland
Date:           Mon Jun 20 01:20:01 UTC 2016

Modified Files:
        src/sys/ufs/lfs: lfs_rename.c

Log Message:
Merge ufs_rename.c 1.11: ufs_gro_genealogy: use vcache_get() to lookup DOTDOT.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/ufs/lfs/lfs_rename.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/ufs/lfs/lfs_rename.c
diff -u src/sys/ufs/lfs/lfs_rename.c:1.18 src/sys/ufs/lfs/lfs_rename.c:1.19
--- src/sys/ufs/lfs/lfs_rename.c:1.18	Mon Jun 20 00:00:47 2016
+++ src/sys/ufs/lfs/lfs_rename.c	Mon Jun 20 01:20:01 2016
@@ -1,5 +1,5 @@
-/*	$NetBSD: lfs_rename.c,v 1.18 2016/06/20 00:00:47 dholland Exp $	*/
-/*  from NetBSD: ufs_rename.c,v 1.10 2014/02/06 10:57:12 hannken Exp  */
+/*	$NetBSD: lfs_rename.c,v 1.19 2016/06/20 01:20:01 dholland Exp $	*/
+/*  from NetBSD: ufs_rename.c,v 1.11 2014/05/25 13:45:39 hannken Exp  */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -89,7 +89,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_rename.c,v 1.18 2016/06/20 00:00:47 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_rename.c,v 1.19 2016/06/20 01:20:01 dholland Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -697,20 +697,15 @@ ulfs_gro_genealogy(struct mount *mp, kau
 		}
 
 		/* 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_no), &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);

Reply via email to