Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Mar 2009 21:54:28 +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: r189993 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/sis kern
Message-ID:  <200903182154.n2ILsSn0038862@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



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