mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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
This commit is contained in:
parent
07a9368a48
commit
f87c8878e6
1 changed files with 16 additions and 4 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue