diff options
author | jhb <jhb@FreeBSD.org> | 2009-03-10 17:00:28 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2009-03-10 17:00:28 +0000 |
commit | 08492346145fe35af92cabab62c9a05774ccfd98 (patch) | |
tree | ad30a5e99551d51f8fd02d25a17f110072f69b89 /sys/kern | |
parent | 3c6380766d1e220490dcc531c718ccdc9ecadc8a (diff) | |
download | FreeBSD-src-08492346145fe35af92cabab62c9a05774ccfd98.zip FreeBSD-src-08492346145fe35af92cabab62c9a05774ccfd98.tar.gz |
- Remove a recently added comment from kernel_sysctlbyname() that isn't
needed.
- Move the release of the sysctl sx lock after the vsunlock() in
userland_sysctl() to restore the original memlock behavior of
minimizing the amount of memory wired to handle sysctl requests.
MFC after: 1 week
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_sysctl.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 9e15b9c..1d283df 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -1200,14 +1200,6 @@ kernel_sysctlbyname(struct thread *td, char *name, void *old, size_t *oldlenp, 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) @@ -1520,10 +1512,10 @@ userland_sysctl(struct thread *td, int *name, u_int namelen, void *old, } CURVNET_RESTORE(); - SYSCTL_XUNLOCK(); if (req.lock == REQ_WIRED && req.validlen > 0) vsunlock(req.oldptr, req.validlen); + SYSCTL_XUNLOCK(); if (error && error != ENOMEM) return (error); |