Module Name: src Committed By: dholland Date: Mon Sep 28 00:39:03 UTC 2009
Modified Files: src/sys/ufs/ufs: ufs_lookup.c Log Message: Avoid nasal demons. Code of the form vput(vp); error = VFS_VGET(vp->v_mount, ...); just isn't right. Because of vnode caching this *probably* never bit anyone, except maybe under very heavy load, but still. To generate a diff of this commit: cvs rdiff -u -r1.101 -r1.102 src/sys/ufs/ufs/ufs_lookup.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/ufs/ufs_lookup.c diff -u src/sys/ufs/ufs/ufs_lookup.c:1.101 src/sys/ufs/ufs/ufs_lookup.c:1.102 --- src/sys/ufs/ufs/ufs_lookup.c:1.101 Sun Feb 22 20:28:07 2009 +++ src/sys/ufs/ufs/ufs_lookup.c Mon Sep 28 00:39:03 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: ufs_lookup.c,v 1.101 2009/02/22 20:28:07 ad Exp $ */ +/* $NetBSD: ufs_lookup.c,v 1.102 2009/09/28 00:39:03 dholland Exp $ */ /* * Copyright (c) 1989, 1993 @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ufs_lookup.c,v 1.101 2009/02/22 20:28:07 ad Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ufs_lookup.c,v 1.102 2009/09/28 00:39:03 dholland Exp $"); #ifdef _KERNEL_OPT #include "opt_ffs.h" @@ -1176,7 +1176,7 @@ int ufs_checkpath(struct inode *source, struct inode *target, kauth_cred_t cred) { - struct vnode *vp = ITOV(target); + struct vnode *nextvp, *vp; int error, rootino, namlen; struct dirtemplate dirbuf; const int needswap = UFS_MPNEEDSWAP(target->i_ump); @@ -1224,13 +1224,15 @@ } if (ufs_rw32(dirbuf.dotdot_ino, needswap) == rootino) break; - vput(vp); + VOP_UNLOCK(vp, 0); error = VFS_VGET(vp->v_mount, - ufs_rw32(dirbuf.dotdot_ino, needswap), &vp); + ufs_rw32(dirbuf.dotdot_ino, needswap), &nextvp); + vrele(vp); if (error) { vp = NULL; break; } + vp = nextvp; } out: