summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_sysctl.c
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2002-08-06 11:28:09 +0000
committertruckman <truckman@FreeBSD.org>2002-08-06 11:28:09 +0000
commit64730354998132922bd83e12ba02fa439e39aa1f (patch)
tree54a47dbbb7acbbaab0b5b903790cbbcb077e9776 /sys/kern/kern_sysctl.c
parentd29f18d0d93c16ce5dd161c066260ee795390b97 (diff)
downloadFreeBSD-src-64730354998132922bd83e12ba02fa439e39aa1f.zip
FreeBSD-src-64730354998132922bd83e12ba02fa439e39aa1f.tar.gz
Don't automagically call vslock() from SYSCTL_OUT(). Instead, complain
about calls to SYSCTL_OUT() made with locks held if the buffer has not been pre-wired. SYSCTL_OUT() should not be called while holding locks, but if this is not possible, the buffer should be wired by calling sysctl_wire_old_buffer() before grabbing any locks.
Diffstat (limited to 'sys/kern/kern_sysctl.c')
-rw-r--r--sys/kern/kern_sysctl.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index 76aa5f6..eb219dc 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -992,10 +992,8 @@ sysctl_old_user(struct sysctl_req *req, const void *p, size_t l)
int error = 0;
size_t i = 0;
- if (req->lock == 1 && req->oldptr) {
- vslock(req->oldptr, req->oldlen);
- req->lock = 2;
- }
+ if (req->lock == 1 && req->oldptr)
+ WITNESS_SLEEP(1, NULL);
if (req->oldptr) {
i = l;
if (req->oldlen <= req->oldidx)
OpenPOWER on IntegriCloud