From 249795444f86484b88b415ebc999ef567ad8cb9a Mon Sep 17 00:00:00 2001 From: markj Date: Tue, 26 Jan 2016 01:15:18 +0000 Subject: Evaluate the sysctl_running fail point before taking the sysctl lock. The fail point handler may sleep, but this is not permitted while holding a rm read lock. MFC after: 1 week Sponsored by: EMC / Isilon Storage Division --- sys/kern/kern_sysctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sys/kern') diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c index 803951f..f57cd58 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -166,6 +166,8 @@ sysctl_root_handler_locked(struct sysctl_oid *oid, void *arg1, intmax_t arg2, if (!(oid->oid_kind & CTLFLAG_MPSAFE)) mtx_unlock(&Giant); + KFAIL_POINT_ERROR(_debug_fail_point, sysctl_running, error); + if (tracker != NULL) SYSCTL_RLOCK(tracker); else @@ -1838,8 +1840,6 @@ sysctl_root(SYSCTL_HANDLER_ARGS) #endif error = sysctl_root_handler_locked(oid, arg1, arg2, req, &tracker); - KFAIL_POINT_ERROR(_debug_fail_point, sysctl_running, error); - out: SYSCTL_RUNLOCK(&tracker); return (error); -- cgit v1.1