hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/net/sunrpc/svc.c
....@@ -800,6 +800,7 @@
800800 static int
801801 svc_stop_kthreads(struct svc_serv *serv, struct svc_pool *pool, int nrservs)
802802 {
803
+ struct svc_rqst *rqstp;
803804 struct task_struct *task;
804805 unsigned int state = serv->sv_nrthreads-1;
805806
....@@ -808,7 +809,10 @@
808809 task = choose_victim(serv, pool, &state);
809810 if (task == NULL)
810811 break;
811
- kthread_stop(task);
812
+ rqstp = kthread_data(task);
813
+ /* Did we lose a race to svo_function threadfn? */
814
+ if (kthread_stop(task) == -EINTR)
815
+ svc_exit_thread(rqstp);
812816 nrservs++;
813817 } while (nrservs < 0);
814818 return 0;
....@@ -991,7 +995,7 @@
991995 #endif
992996 }
993997
994
- trace_svc_register(progname, version, protocol, port, family, error);
998
+ trace_svc_register(progname, version, family, protocol, port, error);
995999 return error;
9961000 }
9971001