]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix the server side krpc so that the kernel nfsd threads terminate.
authorrmacklem <rmacklem@FreeBSD.org>
Mon, 2 Jul 2018 17:50:46 +0000 (17:50 +0000)
committerrmacklem <rmacklem@FreeBSD.org>
Mon, 2 Jul 2018 17:50:46 +0000 (17:50 +0000)
commitb9b81e32655b9395e45f1f16e3774f6f38b5e933
tree3300f4e6cacb0dd74b2d310d91f49e7697051994
parentc365e5c3d1f0b9c35dbd36040cff4c0cea67e923
Fix the server side krpc so that the kernel nfsd threads terminate.

Occationally the kernel nfsd threads would not terminate when a SIGKILL
was posted for the kernel process (called nfsd (slave)). When this occurred,
the thread associated with the process (called "ismaster") had returned from
svc_run_internal() and was sleeping waiting for the other threads to terminate.
The other threads (created by kthread_start()) were still in svc_run_internal()
handling NFS RPCs.
The only way this could occur is for the "ismaster" thread to return from
svc_run_internal() without having called svc_exit().
There was only one place in the code where this could happen and this patch
stops that from happening.
Since the problem is intermittent, I cannot be sure if this has fixed the
problem, but I have not seen an occurrence of the problem with this patch
applied.

Reviewed by: kib
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D16087
sys/rpc/svc.c