From owner-svn-src-all@FreeBSD.ORG Fri Sep 11 12:56:14 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 47316106566C; Fri, 11 Sep 2009 12:56:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 355658FC13; Fri, 11 Sep 2009 12:56:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8BCuDgF052682; Fri, 11 Sep 2009 12:56:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8BCuD0X052680; Fri, 11 Sep 2009 12:56:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200909111256.n8BCuD0X052680@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 11 Sep 2009 12:56:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197087 - in stable/8/sys: . amd64/include/xen cddl/compat/opensolaris/kern cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/xen/xenpci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Sep 2009 12:56:14 -0000 Author: kib Date: Fri Sep 11 12:56:13 2009 New Revision: 197087 URL: http://svn.freebsd.org/changeset/base/197087 Log: MFC r196966: Lock Giant around vn_open_cred(). Remove innocent unnecessary call to NDFREE(). Approved by: re (kensmith) Modified: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c Fri Sep 11 11:42:56 2009 (r197086) +++ stable/8/sys/cddl/compat/opensolaris/kern/opensolaris_kobj.c Fri Sep 11 12:56:13 2009 (r197087) @@ -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); }