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
This commit is contained in:
markj 2016-01-26 01:15:18 +00:00
parent 3d395daf1a
commit 249795444f

View File

@ -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);