summaryrefslogtreecommitdiffstats
path: root/sys/rpc
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2014-12-08 16:33:18 +0000
committerkib <kib@FreeBSD.org>2014-12-08 16:33:18 +0000
commite83a8b4fa1e916a1dfd6ffe59024ef83cd10f294 (patch)
tree38351ddb6510c4d236cd11c5d6015361bbef0d62 /sys/rpc
parent6ad3754659359384a6f7030c01d6028cfb5b3566 (diff)
downloadFreeBSD-src-e83a8b4fa1e916a1dfd6ffe59024ef83cd10f294.zip
FreeBSD-src-e83a8b4fa1e916a1dfd6ffe59024ef83cd10f294.tar.gz
Current reaction of the nfsd worker threads to any signal is exit.
This is not correct at least for the stop requests. Check for stop conditions and suspend threads if requested. Reported and tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week
Diffstat (limited to 'sys/rpc')
-rw-r--r--sys/rpc/svc.c20
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;
}
OpenPOWER on IntegriCloud