Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Nov 2012 12:42:29 +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-9@freebsd.org
Subject:   svn commit: r243484 - stable/9/sys/cddl/compat/opensolaris/kern
Message-ID:  <201211241242.qAOCgTps052324@svn.freebsd.org>

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

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

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

Modified: stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c
==============================================================================
--- stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c	Sat Nov 24 12:40:43 2012	(r243483)
+++ stable/9/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c	Sat Nov 24 12:42:29 2012	(r243484)
@@ -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.qAOCgTps052324>