From 7dbda87219e7bda1f7b868ed231f51f0e67a385d Mon Sep 17 00:00:00 2001 From: avg Date: Sun, 4 Nov 2012 14:16:18 +0000 Subject: opensolaris_lookup: use vfs_busy in traverse before calling VFS_ROOT ... to ensure that we have a valid mountpoint during the call. Reviewed by: kib MFC after: 19 days --- sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sys/cddl') diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c b/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c index a7ec8b9..94383d6 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c +++ b/sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c @@ -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; -- cgit v1.1