Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Feb 2009 22:49:58 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r188739 - stable/7/sys/kern
Message-ID:  <200902172249.n1HMnwAG030037@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Tue Feb 17 22:49:58 2009
New Revision: 188739
URL: http://svn.freebsd.org/changeset/base/188739

Log:
  The previous MFC only fixed the old kern.proc.vmmap sysctl.  Fix the new one
  as well to not hold the vnode lock for vn_fullpath() and only use a shared
  vnode lock for VOP_GETATTR().

Modified:
  stable/7/sys/kern/kern_proc.c

Modified: stable/7/sys/kern/kern_proc.c
==============================================================================
--- stable/7/sys/kern/kern_proc.c	Tue Feb 17 22:46:30 2009	(r188738)
+++ stable/7/sys/kern/kern_proc.c	Tue Feb 17 22:49:58 2009	(r188739)
@@ -1646,12 +1646,11 @@ sysctl_kern_proc_vmmap(SYSCTL_HANDLER_AR
 			kve->kve_shadow_count = obj->shadow_count;
 			VM_OBJECT_UNLOCK(obj);
 			if (vp != NULL) {
-				vfslocked = VFS_LOCK_GIANT(vp->v_mount);
-				vn_lock(vp, LK_EXCLUSIVE | LK_RETRY,
-				    curthread);
 				vn_fullpath(curthread, vp, &fullpath,
 				    &freepath);
 				cred = curthread->td_ucred;
+				vfslocked = VFS_LOCK_GIANT(vp->v_mount);
+				vn_lock(vp, LK_SHARED | LK_RETRY, curthread);
 				if (VOP_GETATTR(vp, &va, cred, curthread) == 0) {
 					kve->kve_fileid = va.va_fileid;
 					kve->kve_fsid = va.va_fsid;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200902172249.n1HMnwAG030037>