summaryrefslogtreecommitdiffstats
path: root/sys/cddl
diff options
context:
space:
mode:
authoravg <avg@FreeBSD.org>2012-11-04 14:16:18 +0000
committeravg <avg@FreeBSD.org>2012-11-04 14:16:18 +0000
commit7dbda87219e7bda1f7b868ed231f51f0e67a385d (patch)
treedfed970aa7c1f2810741ad5f59c6cdcc9e20f7d4 /sys/cddl
parent7a24c90d139bce8a41b84dbbb7d46cbe9b617479 (diff)
downloadFreeBSD-src-7dbda87219e7bda1f7b868ed231f51f0e67a385d.zip
FreeBSD-src-7dbda87219e7bda1f7b868ed231f51f0e67a385d.tar.gz
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
Diffstat (limited to 'sys/cddl')
-rw-r--r--sys/cddl/compat/opensolaris/kern/opensolaris_lookup.c4
1 files changed, 4 insertions, 0 deletions
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;
OpenPOWER on IntegriCloud