diff options
author | kib <kib@FreeBSD.org> | 2009-09-08 09:17:34 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2009-09-08 09:17:34 +0000 |
commit | 69ea57cacb920c98a5e768ad757f3718f2c060a4 (patch) | |
tree | b4de5b68f56f156abfc62dadb087cac67af34cd7 | |
parent | 7faac77b19969bf72936ce583b2ee0d892ce7c7b (diff) | |
download | FreeBSD-src-69ea57cacb920c98a5e768ad757f3718f2c060a4.zip FreeBSD-src-69ea57cacb920c98a5e768ad757f3718f2c060a4.tar.gz |
Lock Giant around vn_open_cred().
Remove innocent unnecessary call to NDFREE().
Reported by: marcel
Reviewed and tested by: pjd
MFC after: 3 days
-rw-r--r-- | sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c b/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c index c214488..d794345 100644 --- a/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c +++ b/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c @@ -69,7 +69,7 @@ kobj_open_file_vnode(const char *file) struct thread *td = curthread; struct filedesc *fd; struct nameidata nd; - int error, flags; + int error, flags, vfslocked; fd = td->td_proc->p_fd; FILEDESC_XLOCK(fd); @@ -86,11 +86,13 @@ kobj_open_file_vnode(const char *file) flags = FREAD | O_NOFOLLOW; NDINIT(&nd, LOOKUP, MPSAFE, UIO_SYSSPACE, file, td); error = vn_open_cred(&nd, &flags, 0, 0, curthread->td_ucred, NULL); - NDFREE(&nd, NDF_ONLY_PNBUF); if (error != 0) return (NULL); + vfslocked = NDHASGIANT(&nd); + NDFREE(&nd, NDF_ONLY_PNBUF); /* We just unlock so we hold a reference. */ VOP_UNLOCK(nd.ni_vp, 0); + VFS_UNLOCK_GIANT(vfslocked); return (nd.ni_vp); } |