[Devel] [PATCH vz9 2/9] ve/sunrpc/nfsd: containerize kthreads

Nikita Yushchenko nikita.yushchenko at virtuozzo.com
Fri Oct 1 09:32:48 MSK 2021


From: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>

This patch set adds proper support for NFSd service in CT's, based on old
template (like RHEL6).
This patch allows to create NFSd kthreads to a containers pid namespace to
allow to stop the service on old distros (they send kill signals to NFSd
kernel threads).

Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>

+++
ve, kthread: Remove some useless crud.

Simplify the code by removing useless macroses.

Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>

(cherry-picked from vz8 commit 0057a5114524 ("ve/sunrpc/nfsd: containerize
kthreads"))

Signed-off-by: Nikita Yushchenko <nikita.yushchenko at virtuozzo.com>
---
 net/sunrpc/svc.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c
index 0de918cb3d90..bf0eedd21974 100644
--- a/net/sunrpc/svc.c
+++ b/net/sunrpc/svc.c
@@ -21,6 +21,7 @@
 #include <linux/module.h>
 #include <linux/kthread.h>
 #include <linux/slab.h>
+#include <linux/ve.h>
 
 #include <linux/sunrpc/types.h>
 #include <linux/sunrpc/xdr.h>
@@ -727,8 +728,10 @@ svc_start_kthreads(struct svc_serv *serv, struct svc_pool *pool, int nrservs)
 			return PTR_ERR(rqstp);
 
 		__module_get(serv->sv_ops->svo_module);
-		task = kthread_create_on_node(serv->sv_ops->svo_function, rqstp,
-					      node, "%s", serv->sv_name);
+		task = kthread_create_on_node_ve_flags(get_exec_env(), 0,
+						 serv->sv_ops->svo_function,
+						 rqstp, node,
+						 "%s", serv->sv_name);
 		if (IS_ERR(task)) {
 			module_put(serv->sv_ops->svo_module);
 			svc_exit_thread(rqstp);
-- 
2.30.2



More information about the Devel mailing list