svn commit: r189993 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/sis kern

John Baldwin jhb at FreeBSD.org
Wed Mar 18 14:54:30 PDT 2009


Author: jhb
Date: Wed Mar 18 21:54:28 2009
New Revision: 189993
URL: http://svn.freebsd.org/changeset/base/189993

Log:
  MFC: Remove a comment and expand scope of sysctl sx lock a bit to fully
  restore limiting of wired memory by userspace for sysctls.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/dev/sis/if_sis.c   (props changed)
  stable/7/sys/dev/sis/if_sisreg.h   (props changed)
  stable/7/sys/kern/kern_sysctl.c

Modified: stable/7/sys/kern/kern_sysctl.c
==============================================================================
--- stable/7/sys/kern/kern_sysctl.c	Wed Mar 18 21:51:11 2009	(r189992)
+++ stable/7/sys/kern/kern_sysctl.c	Wed Mar 18 21:54:28 2009	(r189993)
@@ -1199,14 +1199,6 @@ kernel_sysctlbyname(struct thread *td, c
 	oid[1] = 3;		/* name2oid */
 	oidlen = sizeof(oid);
 
-	/*
-	 * XXX: Prone to a possible race condition between lookup and
-	 * execution? Maybe put locking around it?
-	 *
-	 * Userland is just as racy, so I think the current implementation
-	 * is fine.
-	 */
-
 	error = kernel_sysctl(td, oid, 2, oid, &oidlen,
 	    (void *)name, strlen(name), &plen, flags);
 	if (error)
@@ -1517,10 +1509,10 @@ userland_sysctl(struct thread *td, int *
 		uio_yield();
 	}
 
-	SYSCTL_XUNLOCK();
 
 	if (req.lock == REQ_WIRED && req.validlen > 0)
 		vsunlock(req.oldptr, req.validlen);
+	SYSCTL_XUNLOCK();
 
 	if (error && error != ENOMEM)
 		return (error);


More information about the svn-src-stable-7 mailing list