Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Nov 2012 12:42:42 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r243485 - stable/8/sys/cddl/compat/opensolaris/kern
Message-ID:  <201211241242.qAOCgg84052380@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Sat Nov 24 12:42:42 2012
New Revision: 243485
URL: http://svnweb.freebsd.org/changeset/base/243485

Log:
  MFC r242569: opensolaris_lookup: use vfs_busy in traverse before calling VFS_ROOT

Modified:
  stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/cddl/   (props changed)

Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c
==============================================================================
--- stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c	Sat Nov 24 12:42:29 2012	(r243484)
+++ stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c	Sat Nov 24 12:42:42 2012	(r243485)
@@ -88,6 +88,7 @@ traverse(vnode_t **cvpp, int lktype)
 		vfsp = vn_mountedvfs(cvp);
 		if (vfsp == NULL)
 			break;
+		error = vfs_busy(vfsp, 0);
 		/*
 		 * tvp is NULL for *cvpp vnode, which we can't unlock.
 		 */
@@ -95,12 +96,15 @@ traverse(vnode_t **cvpp, int lktype)
 			vput(cvp);
 		else
 			vrele(cvp);
+		if (error)
+			return (error);
 
 		/*
 		 * The read lock must be held across the call to VFS_ROOT() to
 		 * prevent a concurrent unmount from destroying the vfs.
 		 */
 		error = VFS_ROOT(vfsp, lktype, &tvp);
+		vfs_unbusy(vfsp);
 		if (error != 0)
 			return (error);
 		cvp = tvp;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201211241242.qAOCgg84052380>