Index: sys/kern/vnode_if.src
===================================================================
RCS file: /cvsroot/src/sys/kern/vnode_if.src,v
retrieving revision 1.62
diff -p -u -4 -r1.62 vnode_if.src
--- sys/kern/vnode_if.src	11 Jul 2011 08:23:00 -0000	1.62
+++ sys/kern/vnode_if.src	9 Oct 2011 13:39:20 -0000
@@ -140,9 +140,9 @@ vop_access {
 	IN kauth_cred_t cred;
 };
 
 #
-#% getattr    vp      = = =
+#% getattr    vp      L L L
 #
 vop_getattr {
 	IN struct vnode *vp;
 	IN struct vattr *vap;
Index: sys/compat/linux/common/linux_file.c
===================================================================
RCS file: /cvsroot/src/sys/compat/linux/common/linux_file.c,v
retrieving revision 1.103
diff -p -u -4 -r1.103 linux_file.c
--- sys/compat/linux/common/linux_file.c	14 Apr 2011 00:59:06 -0000	1.103
+++ sys/compat/linux/common/linux_file.c	9 Oct 2011 13:39:14 -0000
@@ -339,9 +339,11 @@ linux_sys_fcntl(struct lwp *l, const str
 			cmd = cmd == LINUX_F_SETOWN ? F_SETOWN : F_GETOWN;
 			break;
 		}
 
+		vn_lock(vp, LK_SHARED | LK_RETRY);
 		error = VOP_GETATTR(vp, &va, l->l_cred);
+		VOP_UNLOCK(vp);
 
 		fd_putfile(fd);
 
 		if (error)
Index: sys/compat/linux/common/linux_file64.c
===================================================================
RCS file: /cvsroot/src/sys/compat/linux/common/linux_file64.c,v
retrieving revision 1.52
diff -p -u -4 -r1.52 linux_file64.c
--- sys/compat/linux/common/linux_file64.c	1 Sep 2011 12:44:10 -0000	1.52
+++ sys/compat/linux/common/linux_file64.c	9 Oct 2011 13:39:14 -0000
@@ -257,9 +257,12 @@ linux_sys_getdents64(struct lwp *l, cons
 		error = ENOTDIR;
 		goto out1;
 	}
 
-	if ((error = VOP_GETATTR(vp, &va, l->l_cred)))
+	vn_lock(vp, LK_SHARED | LK_RETRY);
+	error = VOP_GETATTR(vp, &va, l->l_cred);
+	VOP_UNLOCK(vp);
+	if (error)
 		goto out1;
 
 	nbytes = SCARG(uap, count);
 	buflen = min(MAXBSIZE, nbytes);
Index: sys/compat/linux/common/linux_ioctl.c
===================================================================
RCS file: /cvsroot/src/sys/compat/linux/common/linux_ioctl.c,v
retrieving revision 1.55
diff -p -u -4 -r1.55 linux_ioctl.c
--- sys/compat/linux/common/linux_ioctl.c	19 Jul 2008 23:01:52 -0000	1.55
+++ sys/compat/linux/common/linux_ioctl.c	9 Oct 2011 13:39:14 -0000
@@ -127,8 +127,9 @@ linux_sys_ioctl(struct lwp *l, const str
 		 * the ioctl, so we have to differentiate them in another
 		 * way.  We do it by indexing in the cdevsw with the major
 		 * device number and check if that is the sequencer entry.
 		 */
+		bool is_sequencer = false;
 		struct file *fp;
 		struct vnode *vp;
 		struct vattr va;
 		extern const struct cdevsw sequencer_cdevsw;
@@ -136,11 +137,17 @@ linux_sys_ioctl(struct lwp *l, const str
 		if ((fp = fd_getfile(SCARG(uap, fd))) == NULL)
 			return EBADF;
 		if (fp->f_type == DTYPE_VNODE &&
 		    (vp = (struct vnode *)fp->f_data) != NULL &&
-		    vp->v_type == VCHR &&
-		    VOP_GETATTR(vp, &va, l->l_cred) == 0 &&
-		    cdevsw_lookup(va.va_rdev) == &sequencer_cdevsw) {
+		    vp->v_type == VCHR) {
+			vn_lock(vp, LK_SHARED | LK_RETRY);
+			error = VOP_GETATTR(vp, &va, l->l_cred);
+			VOP_UNLOCK(vp);
+			if (error == 0 &&
+			    cdevsw_lookup(va.va_rdev) == &sequencer_cdevsw)
+				is_sequencer = true;
+		}
+		if (is_sequencer) {
 			error = oss_ioctl_sequencer(l, (const void *)LINUX_TO_OSS(uap),
 						   retval);
 		}
 		else {
Index: sys/compat/linux/common/linux_misc.c
===================================================================
RCS file: /cvsroot/src/sys/compat/linux/common/linux_misc.c,v
retrieving revision 1.218
diff -p -u -4 -r1.218 linux_misc.c
--- sys/compat/linux/common/linux_misc.c	2 Nov 2010 18:18:07 -0000	1.218
+++ sys/compat/linux/common/linux_misc.c	9 Oct 2011 13:39:14 -0000
@@ -695,9 +695,12 @@ linux_sys_getdents(struct lwp *l, const 
 		error = ENOTDIR;
 		goto out1;
 	}
 
-	if ((error = VOP_GETATTR(vp, &va, l->l_cred)))
+	vn_lock(vp, LK_SHARED | LK_RETRY);
+	error = VOP_GETATTR(vp, &va, l->l_cred);
+	VOP_UNLOCK(vp);
+	if (error)
 		goto out1;
 
 	nbytes = SCARG(uap, count);
 	if (nbytes == 1) {	/* emulating old, broken behaviour */
Index: sys/compat/linux32/common/linux32_dirent.c
===================================================================
RCS file: /cvsroot/src/sys/compat/linux32/common/linux32_dirent.c,v
retrieving revision 1.12
diff -p -u -4 -r1.12 linux32_dirent.c
--- sys/compat/linux32/common/linux32_dirent.c	11 Sep 2010 20:53:04 -0000	1.12
+++ sys/compat/linux32/common/linux32_dirent.c	9 Oct 2011 13:39:14 -0000
@@ -129,9 +129,12 @@ linux32_sys_getdents(struct lwp *l, cons
 		error = ENOTDIR;
 		goto out1;
 	}
 
-	if ((error = VOP_GETATTR(vp, &va, l->l_cred)))
+	vn_lock(vp, LK_SHARED | LK_RETRY);
+	error = VOP_GETATTR(vp, &va, l->l_cred);
+	VOP_UNLOCK(vp);
+	if (error)
 		goto out1;
 
 	nbytes = SCARG(uap, count);
 	if (nbytes == 1) {	/* emulating old, broken behaviour */
Index: sys/compat/ossaudio/ossaudio.c
===================================================================
RCS file: /cvsroot/src/sys/compat/ossaudio/ossaudio.c,v
retrieving revision 1.66
diff -p -u -4 -r1.66 ossaudio.c
--- sys/compat/ossaudio/ossaudio.c	6 Sep 2011 01:19:34 -0000	1.66
+++ sys/compat/ossaudio/ossaudio.c	9 Oct 2011 13:39:14 -0000
@@ -934,18 +934,21 @@ getdevinfo(file_t *fp)
 	struct vnode *vp;
 	struct vattr va;
 	static struct audiodevinfo devcache;
 	struct audiodevinfo *di = &devcache;
-	int mlen, dlen;
+	int error, mlen, dlen;
 
 	/*
 	 * Figure out what device it is so we can check if the
 	 * cached data is valid.
 	 */
 	vp = fp->f_data;
 	if (vp->v_type != VCHR)
 		return 0;
-	if (VOP_GETATTR(vp, &va, kauth_cred_get()))
+	vn_lock(vp, LK_SHARED | LK_RETRY);
+	error = VOP_GETATTR(vp, &va, kauth_cred_get());
+	VOP_UNLOCK(vp);
+	if (error)
 		return 0;
 	if (di->done && di->dev == va.va_rdev)
 		return di;
 
Index: sys/compat/svr4/svr4_fcntl.c
===================================================================
RCS file: /cvsroot/src/sys/compat/svr4/svr4_fcntl.c,v
retrieving revision 1.70
diff -p -u -4 -r1.70 svr4_fcntl.c
--- sys/compat/svr4/svr4_fcntl.c	28 Apr 2008 20:23:45 -0000	1.70
+++ sys/compat/svr4/svr4_fcntl.c	9 Oct 2011 13:39:15 -0000
@@ -262,9 +262,12 @@ fd_truncate(struct lwp *l, int fd, struc
 	if (fp->f_type != DTYPE_VNODE || vp->v_type == VFIFO) {
 		fd_putfile(fd);
 		return ESPIPE;
 	}
-	if ((error = VOP_GETATTR(vp, &vattr, l->l_cred)) != 0) {
+	vn_lock(vp, LK_SHARED | LK_RETRY);
+	error = VOP_GETATTR(vp, &vattr, l->l_cred);
+	VOP_UNLOCK(vp);
+	if (error) {
 		fd_putfile(fd);
 		return error;
 	}
 
Index: sys/compat/svr4_32/svr4_32_fcntl.c
===================================================================
RCS file: /cvsroot/src/sys/compat/svr4_32/svr4_32_fcntl.c,v
retrieving revision 1.34
diff -p -u -4 -r1.34 svr4_32_fcntl.c
--- sys/compat/svr4_32/svr4_32_fcntl.c	28 Apr 2008 20:23:46 -0000	1.34
+++ sys/compat/svr4_32/svr4_32_fcntl.c	9 Oct 2011 13:39:15 -0000
@@ -260,9 +260,12 @@ fd_truncate(struct lwp *l, int fd, struc
 	if (fp->f_type != DTYPE_VNODE || vp->v_type == VFIFO) {
 		fd_putfile(fd);
 		return ESPIPE;
 	}
-	if ((error = VOP_GETATTR(vp, &vattr, l->l_cred)) != 0) {
+	vn_lock(vp, LK_SHARED | LK_RETRY);
+	error = VOP_GETATTR(vp, &vattr, l->l_cred);
+	VOP_UNLOCK(vp);
+	if (error) {
 		fd_putfile(fd);
 		return error;
 	}
 
Index: sys/dev/ccd.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ccd.c,v
retrieving revision 1.141
diff -p -u -4 -r1.141 ccd.c
--- sys/dev/ccd.c	4 Jul 2011 16:06:45 -0000	1.141
+++ sys/dev/ccd.c	9 Oct 2011 13:39:15 -0000
@@ -309,9 +309,12 @@ ccdinit(struct ccd_softc *cs, char **cpa
 
 		/*
 		 * XXX: Cache the component's dev_t.
 		 */
-		if ((error = VOP_GETATTR(vpp[ix], &va, l->l_cred)) != 0) {
+		vn_lock(vpp[ix], LK_SHARED | LK_RETRY);
+		error = VOP_GETATTR(vpp[ix], &va, l->l_cred);
+		VOP_UNLOCK(vpp[ix]);
+		if (error != 0) {
 #ifdef DEBUG
 			if (ccddebug & (CCDB_FOLLOW|CCDB_INIT))
 				printf("%s: %s: getattr failed %s = %d\n",
 				    cs->sc_xname, ci->ci_path,
Index: sys/dev/cgd.c
===================================================================
RCS file: /cvsroot/src/sys/dev/cgd.c,v
retrieving revision 1.74
diff -p -u -4 -r1.74 cgd.c
--- sys/dev/cgd.c	21 Jun 2011 06:23:38 -0000	1.74
+++ sys/dev/cgd.c	9 Oct 2011 13:39:15 -0000
@@ -772,9 +772,12 @@ cgdinit(struct cgd_softc *cs, const char
 		goto bail;
 	cs->sc_tpath = malloc(cs->sc_tpathlen, M_DEVBUF, M_WAITOK);
 	memcpy(cs->sc_tpath, tmppath, cs->sc_tpathlen);
 
-	if ((ret = VOP_GETATTR(vp, &va, l->l_cred)) != 0)
+	vn_lock(vp, LK_SHARED | LK_RETRY);
+	ret = VOP_GETATTR(vp, &va, l->l_cred);
+	VOP_UNLOCK(vp);
+	if (ret != 0)
 		goto bail;
 
 	cs->sc_tdev = va.va_rdev;
 
Index: sys/dev/vnd.c
===================================================================
RCS file: /cvsroot/src/sys/dev/vnd.c,v
retrieving revision 1.218
diff -p -u -4 -r1.218 vnd.c
--- sys/dev/vnd.c	29 Jun 2011 09:12:42 -0000	1.218
+++ sys/dev/vnd.c	9 Oct 2011 13:39:15 -0000
@@ -917,8 +917,9 @@ vndwrite(dev_t dev, struct uio *uio, int
 
 static int
 vnd_cget(struct lwp *l, int unit, int *un, struct vattr *va)
 {
+	int error;
 	struct vnd_softc *vnd;
 
 	if (*un == -1)
 		*un = unit;
@@ -931,9 +932,12 @@ vnd_cget(struct lwp *l, int unit, int *u
 
 	if ((vnd->sc_flags & VNF_INITED) == 0)
 		return -1;
 
-	return VOP_GETATTR(vnd->sc_vp, va, l->l_cred);
+	vn_lock(vnd->sc_vp, LK_SHARED | LK_RETRY);
+	error = VOP_GETATTR(vnd->sc_vp, va, l->l_cred);
+	VOP_UNLOCK(vnd->sc_vp);
+	return error;
 }
 
 static int
 vnddoclear(struct vnd_softc *vnd, int pmask, int minor, bool force)
Index: sys/dev/dm/dm_target_linear.c
===================================================================
RCS file: /cvsroot/src/sys/dev/dm/dm_target_linear.c,v
retrieving revision 1.12
diff -p -u -4 -r1.12 dm_target_linear.c
--- sys/dev/dm/dm_target_linear.c	23 Dec 2010 14:58:13 -0000	1.12
+++ sys/dev/dm/dm_target_linear.c	9 Oct 2011 13:39:15 -0000
@@ -200,9 +200,12 @@ dm_target_linear_deps(dm_table_entry_t *
 		return ENOENT;
 
 	tlc = table_en->target_config;
 
-	if ((error = VOP_GETATTR(tlc->pdev->pdev_vnode, &va, curlwp->l_cred)) != 0)
+	vn_lock(tlc->pdev->pdev_vnode, LK_SHARED | LK_RETRY);
+	error = VOP_GETATTR(tlc->pdev->pdev_vnode, &va, curlwp->l_cred);
+	VOP_UNLOCK(tlc->pdev->pdev_vnode);
+	if (error != 0)
 		return error;
 
 	prop_array_add_uint64(prop_array, (uint64_t) va.va_rdev);
 
Index: sys/dev/dm/dm_target_snapshot.c
===================================================================
RCS file: /cvsroot/src/sys/dev/dm/dm_target_snapshot.c,v
retrieving revision 1.14
diff -p -u -4 -r1.14 dm_target_snapshot.c
--- sys/dev/dm/dm_target_snapshot.c	23 Dec 2010 14:58:13 -0000	1.14
+++ sys/dev/dm/dm_target_snapshot.c	9 Oct 2011 13:39:15 -0000
@@ -356,17 +356,23 @@ dm_target_snapshot_deps(dm_table_entry_t
 		return 0;
 
 	tsc = table_en->target_config;
 
-	if ((error = VOP_GETATTR(tsc->tsc_snap_dev->pdev_vnode, &va, curlwp->l_cred)) != 0)
+	vn_lock(tsc->tsc_snap_dev->pdev_vnode, LK_SHARED | LK_RETRY);
+	error = VOP_GETATTR(tsc->tsc_snap_dev->pdev_vnode, &va, curlwp->l_cred);
+	VOP_UNLOCK(tsc->tsc_snap_dev->pdev_vnode);
+	if (error != 0)
 		return error;
 
 	prop_array_add_uint64(prop_array, (uint64_t) va.va_rdev);
 
 	if (tsc->tsc_persistent_dev) {
 
-		if ((error = VOP_GETATTR(tsc->tsc_cow_dev->pdev_vnode, &va,
-			    curlwp->l_cred)) != 0)
+		vn_lock(tsc->tsc_cow_dev->pdev_vnode, LK_SHARED | LK_RETRY);
+		error = VOP_GETATTR(tsc->tsc_cow_dev->pdev_vnode, &va,
+		    curlwp->l_cred);
+		VOP_UNLOCK(tsc->tsc_cow_dev->pdev_vnode);
+		if (error != 0)
 			return error;
 
 		prop_array_add_uint64(prop_array, (uint64_t) va.va_rdev);
 
@@ -533,10 +539,13 @@ dm_target_snapshot_orig_deps(dm_table_en
 		return 0;
 
 	tsoc = table_en->target_config;
 
-	if ((error = VOP_GETATTR(tsoc->tsoc_real_dev->pdev_vnode, &va,
-		    curlwp->l_cred)) != 0)
+	vn_lock(tsoc->tsoc_real_dev->pdev_vnode, LK_SHARED | LK_RETRY);
+	error = VOP_GETATTR(tsoc->tsoc_real_dev->pdev_vnode, &va,
+	    curlwp->l_cred);
+	VOP_UNLOCK(tsoc->tsoc_real_dev->pdev_vnode);
+	if (error != 0)
 		return error;
 
 	prop_array_add_uint64(prop_array, (uint64_t) va.va_rdev);
 
Index: sys/dev/dm/dm_target_stripe.c
===================================================================
RCS file: /cvsroot/src/sys/dev/dm/dm_target_stripe.c,v
retrieving revision 1.15
diff -p -u -4 -r1.15 dm_target_stripe.c
--- sys/dev/dm/dm_target_stripe.c	27 Aug 2011 17:09:09 -0000	1.15
+++ sys/dev/dm/dm_target_stripe.c	9 Oct 2011 13:39:15 -0000
@@ -328,9 +328,12 @@ dm_target_stripe_deps(dm_table_entry_t *
 
 	tsc = table_en->target_config;
 
 	TAILQ_FOREACH(tlc, &tsc->stripe_devs, entries) {
-		if ((error = VOP_GETATTR(tlc->pdev->pdev_vnode, &va, curlwp->l_cred)) != 0)
+		vn_lock(tlc->pdev->pdev_vnode, LK_SHARED | LK_RETRY);
+		error = VOP_GETATTR(tlc->pdev->pdev_vnode, &va, curlwp->l_cred);
+		VOP_UNLOCK(tlc->pdev->pdev_vnode);
+		if (error != 0)
 			return error;
 
 		prop_array_add_uint64(prop_array, (uint64_t) va.va_rdev);
 	}
Index: sys/dev/raidframe/rf_copyback.c
===================================================================
RCS file: /cvsroot/src/sys/dev/raidframe/rf_copyback.c,v
retrieving revision 1.48
diff -p -u -4 -r1.48 rf_copyback.c
--- sys/dev/raidframe/rf_copyback.c	3 Aug 2011 14:44:38 -0000	1.48
+++ sys/dev/raidframe/rf_copyback.c	9 Oct 2011 13:39:16 -0000
@@ -159,9 +159,12 @@ rf_CopybackReconstructedData(RF_Raid_t *
 
 		/* Ok, so we can at least do a lookup... How about actually
 		 * getting a vp for it? */
 
-		if ((retcode = VOP_GETATTR(vp, &va, curlwp->l_cred)) != 0)
+		vn_lock(vp, LK_SHARED | LK_RETRY);
+		retcode = VOP_GETATTR(vp, &va, curlwp->l_cred);
+		VOP_UNLOCK(vp);
+		if (retcode != 0)
 			return;
 		retcode = rf_getdisksize(vp, &raidPtr->Disks[fcol]);
 		if (retcode) {
 			return;
Index: sys/dev/raidframe/rf_disks.c
===================================================================
RCS file: /cvsroot/src/sys/dev/raidframe/rf_disks.c,v
retrieving revision 1.81
diff -p -u -4 -r1.81 rf_disks.c
--- sys/dev/raidframe/rf_disks.c	3 Aug 2011 14:44:38 -0000	1.81
+++ sys/dev/raidframe/rf_disks.c	9 Oct 2011 13:39:16 -0000
@@ -629,9 +629,12 @@ rf_ConfigureDisk(RF_Raid_t *raidPtr, cha
 	if (raidPtr->bytesPerSector == 0)
 		raidPtr->bytesPerSector = diskPtr->blockSize;
 
 	if (diskPtr->status == rf_ds_optimal) {
-		if ((error = VOP_GETATTR(vp, &va, curlwp->l_cred)) != 0) 
+		vn_lock(vp, LK_SHARED | LK_RETRY);
+		error = VOP_GETATTR(vp, &va, curlwp->l_cred);
+		VOP_UNLOCK(vp);
+		if (error != 0)
 			return (error);
 
 		raidPtr->raid_cinfo[col].ci_vp = vp;
 		raidPtr->raid_cinfo[col].ci_dev = va.va_rdev;
Index: sys/dev/raidframe/rf_reconstruct.c
===================================================================
RCS file: /cvsroot/src/sys/dev/raidframe/rf_reconstruct.c,v
retrieving revision 1.116
diff -p -u -4 -r1.116 rf_reconstruct.c
--- sys/dev/raidframe/rf_reconstruct.c	3 Aug 2011 15:00:29 -0000	1.116
+++ sys/dev/raidframe/rf_reconstruct.c	9 Oct 2011 13:39:17 -0000
@@ -455,9 +455,12 @@ rf_ReconstructInPlace(RF_Raid_t *raidPtr
 
 	/* Ok, so we can at least do a lookup...
 	   How about actually getting a vp for it? */
 
-	if ((retcode = VOP_GETATTR(vp, &va, curlwp->l_cred)) != 0) {
+	vn_lock(vp, LK_SHARED | LK_RETRY);
+	retcode = VOP_GETATTR(vp, &va, curlwp->l_cred);
+	VOP_UNLOCK(vp);
+	if (retcode != 0) {
 		vn_close(vp, FREAD | FWRITE, kauth_cred_get());
 		rf_lock_mutex2(raidPtr->mutex);
 		raidPtr->reconInProgress--;
 		rf_signal_cond2(raidPtr->waitForReconCond);
Index: sys/kern/kern_verifiedexec.c
===================================================================
RCS file: /cvsroot/src/sys/kern/kern_verifiedexec.c,v
retrieving revision 1.126
diff -p -u -4 -r1.126 kern_verifiedexec.c
--- sys/kern/kern_verifiedexec.c	1 Sep 2011 18:33:11 -0000	1.126
+++ sys/kern/kern_verifiedexec.c	9 Oct 2011 13:39:19 -0000
@@ -410,9 +410,11 @@ veriexec_fp_calc(struct lwp *l, struct v
 	off_t offset, len;
 	size_t resid, npages;
 	int error, do_perpage, pagen;
 
+	vn_lock(vp, LK_SHARED | LK_RETRY);
 	error = VOP_GETATTR(vp, &va, l->l_cred);
+	VOP_UNLOCK(vp);
 	if (error)
 		return (error);
 
 #ifdef notyet /* XXX - for now */
Index: sys/kern/vfs_mount.c
===================================================================
RCS file: /cvsroot/src/sys/kern/vfs_mount.c,v
retrieving revision 1.10
diff -p -u -4 -r1.10 vfs_mount.c
--- sys/kern/vfs_mount.c	7 Oct 2011 09:35:05 -0000	1.10
+++ sys/kern/vfs_mount.c	9 Oct 2011 13:39:19 -0000
@@ -663,10 +663,16 @@ mount_domount(struct lwp *l, vnode_t **v
 	/*
 	 * If the user is not root, ensure that they own the directory
 	 * onto which we are attempting to mount.
 	 */
-	if ((error = VOP_GETATTR(vp, &va, l->l_cred)) != 0 ||
-	    (va.va_uid != kauth_cred_geteuid(l->l_cred) &&
+	vn_lock(vp, LK_SHARED | LK_RETRY);
+	error = VOP_GETATTR(vp, &va, l->l_cred);
+	VOP_UNLOCK(vp);
+	if (error != 0) {
+		vfs_delref(vfsops);
+		return error;
+	}
+	if ((va.va_uid != kauth_cred_geteuid(l->l_cred) &&
 	    (error = kauth_authorize_generic(l->l_cred,
 	    KAUTH_GENERIC_ISSUSER, NULL)) != 0)) {
 		vfs_delref(vfsops);
 		return error;
Index: sys/kern/vfs_syscalls.c
===================================================================
RCS file: /cvsroot/src/sys/kern/vfs_syscalls.c,v
retrieving revision 1.439
diff -p -u -4 -r1.439 vfs_syscalls.c
--- sys/kern/vfs_syscalls.c	22 Aug 2011 22:12:34 -0000	1.439
+++ sys/kern/vfs_syscalls.c	9 Oct 2011 13:39:19 -0000
@@ -2159,9 +2159,11 @@ sys_lseek(struct lwp *l, const struct sy
 	case SEEK_CUR:
 		newoff = fp->f_offset + SCARG(uap, offset);
 		break;
 	case SEEK_END:
+		vn_lock(vp, LK_SHARED | LK_RETRY);
 		error = VOP_GETATTR(vp, &vattr, cred);
+		VOP_UNLOCK(vp);
 		if (error) {
 			goto out;
 		}
 		newoff = SCARG(uap, offset) + vattr.va_size;
@@ -3827,9 +3829,12 @@ dorevoke(struct vnode *vp, kauth_cred_t 
 {
 	struct vattr vattr;
 	int error;
 
-	if ((error = VOP_GETATTR(vp, &vattr, cred)) != 0)
+	vn_lock(vp, LK_SHARED | LK_RETRY);
+	error = VOP_GETATTR(vp, &vattr, cred);
+	VOP_UNLOCK(vp);
+	if (error != 0)
 		return error;
 	if (kauth_cred_geteuid(cred) == vattr.va_uid ||
 	    (error = kauth_authorize_generic(cred,
 	    KAUTH_GENERIC_ISSUSER, NULL)) == 0)
Index: sys/kern/vfs_vnops.c
===================================================================
RCS file: /cvsroot/src/sys/kern/vfs_vnops.c,v
retrieving revision 1.182
diff -p -u -4 -r1.182 vfs_vnops.c
--- sys/kern/vfs_vnops.c	16 Aug 2011 22:33:38 -0000	1.182
+++ sys/kern/vfs_vnops.c	9 Oct 2011 13:39:20 -0000
@@ -688,10 +688,11 @@ vn_ioctl(file_t *fp, u_long com, void *d
 
 	case VREG:
 	case VDIR:
 		if (com == FIONREAD) {
-			error = VOP_GETATTR(vp, &vattr,
-			    kauth_cred_get());
+			vn_lock(vp, LK_SHARED | LK_RETRY);
+			error = VOP_GETATTR(vp, &vattr, kauth_cred_get());
+			VOP_UNLOCK(vp);
 			if (error)
 				return (error);
 			*(int *)data = vattr.va_size - fp->f_offset;
 			return (0);
Index: sys/uvm/uvm_mmap.c
===================================================================
RCS file: /cvsroot/src/sys/uvm/uvm_mmap.c,v
retrieving revision 1.137
diff -p -u -4 -r1.137 uvm_mmap.c
--- sys/uvm/uvm_mmap.c	23 Jun 2011 23:42:44 -0000	1.137
+++ sys/uvm/uvm_mmap.c	9 Oct 2011 13:39:25 -0000
@@ -459,10 +459,12 @@ sys_mmap(struct lwp *l, const struct sys
 			 * otherwise, if we have asked for PROT_WRITE, return
 			 * EPERM.
 			 */
 			if (fp->f_flag & FWRITE) {
-				if ((error =
-				    VOP_GETATTR(vp, &va, l->l_cred))) {
+				vn_lock(vp, LK_SHARED | LK_RETRY);
+				error = VOP_GETATTR(vp, &va, l->l_cred);
+				VOP_UNLOCK(vp);
+				if (error) {
 					fd_putfile(fd);
 					return (error);
 				}
 				if ((va.va_flags &
