diff options
author | kib <kib@FreeBSD.org> | 2014-12-15 10:58:02 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2014-12-15 10:58:02 +0000 |
commit | 1eabc00156ab7d2214abe4d0bfb6ea2127985ced (patch) | |
tree | ba48c1b8a163238329d0ef389a38fe7d09d92900 /sys/rpc/svc.c | |
parent | 7ad7084d8fef1525abdcf00dd1ee73117dd61ed9 (diff) | |
download | FreeBSD-src-1eabc00156ab7d2214abe4d0bfb6ea2127985ced.zip FreeBSD-src-1eabc00156ab7d2214abe4d0bfb6ea2127985ced.tar.gz |
MFC r275618:
Check for stop condition in nfsd threads.
Diffstat (limited to 'sys/rpc/svc.c')
-rw-r--r-- | sys/rpc/svc.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/sys/rpc/svc.c b/sys/rpc/svc.c index 95d4c49..75d9d6e 100644 --- a/sys/rpc/svc.c +++ b/sys/rpc/svc.c @@ -1101,6 +1101,7 @@ svc_run_internal(SVCGROUP *grp, bool_t ismaster) SVCXPRT *xprt; enum xprt_stat stat; struct svc_req *rqstp; + struct proc *p; size_t sz; int error; @@ -1183,11 +1184,22 @@ svc_run_internal(SVCGROUP *grp, bool_t ismaster) > grp->sg_minthreads) && !st->st_xprt) break; - } else if (error) { + } else if (error != 0) { + KASSERT(error == EINTR || error == ERESTART, + ("non-signal error %d", error)); mtx_unlock(&grp->sg_lock); - svc_exit(pool); - mtx_lock(&grp->sg_lock); - break; + p = curproc; + PROC_LOCK(p); + if (P_SHOULDSTOP(p)) { + thread_suspend_check(0); + PROC_UNLOCK(p); + mtx_lock(&grp->sg_lock); + } else { + PROC_UNLOCK(p); + svc_exit(pool); + mtx_lock(&grp->sg_lock); + break; + } } continue; } |