[Devel] [PATCH RH8] ve/nfsd: don't disable UMH client tracker globally due to single Container misconfiguration

Vasily Averin vvs at virtuozzo.com
Mon May 31 09:47:57 MSK 2021


If UMH client tracker fails to init in a single Container due to, for
example, corrupted "/sbin/nfsdcltrack" binary, currently UMH client
tracker is disabled globally on the node as it's not virtualized.

Let's print a ratelimited warning instead, but don't disable the UMH
tracker.

Fixes: vz8: 182ddb5cb6a2 ("ve/nfsd: enable UMH client tracker in a container")

https://jira.sw.ru/browse/PSBM-102363

Signed-off-by: Konstantin Khorenko <khorenko at virtuozzo.com>
(cherry picked from vz7 commit 2f5f5e585b0bcb8ee61e9c8960ca094aca3ecde1)
Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
 fs/nfsd/nfs4recover.c | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
index cb947b72fc5a..b7bdb5afa7a5 100644
--- a/fs/nfsd/nfs4recover.c
+++ b/fs/nfsd/nfs4recover.c
@@ -1810,6 +1810,7 @@ nfsd4_cltrack_grace_start(time64_t grace_start)
 static int
 nfsd4_umh_cltrack_upcall(char *cmd, char *arg, char *env0, char *env1)
 {
+	struct ve_struct *ve;
 	char *envp[3];
 	char *argv[4];
 	int ret;
@@ -1833,18 +1834,20 @@ nfsd4_umh_cltrack_upcall(char *cmd, char *arg, char *env0, char *env1)
 	argv[2] = arg;
 	argv[3] = NULL;
 
-	ret = call_usermodehelper_ve(get_exec_env(), argv[0], argv, envp, UMH_WAIT_PROC);
+	ve = get_exec_env();
+	ret = call_usermodehelper_ve(ve, argv[0], argv, envp, UMH_WAIT_PROC);
 	/*
-	 * Disable the upcall mechanism if we're getting an ENOENT or EACCES
-	 * error. The admin can re-enable it on the fly by using sysfs
-	 * once the problem has been fixed.
+	 * - NFSd can be running inside Containers
+	 * - "cltrack_prog" is not virtualized
+	 * => let's don't disable UMH client tracking for all NFS servers
+	 *    on the whole Node due to a single incorrect Container
 	 */
-	if (ret == -ENOENT || ret == -EACCES) {
-		dprintk("NFSD: %s was not found or isn't executable (%d). "
-			"Setting cltrack_prog to blank string!",
-			cltrack_prog, ret);
-		cltrack_prog[0] = '\0';
-	}
+	if (ret == -ENOENT || ret == -EACCES)
+		ve_pr_warn_ratelimited(VE_LOG_BOTH,
+			"NFSD: %s was not found or isn't executable (%d) "
+			"in CT#%s\n",
+			cltrack_prog, ret, ve_name(ve));
+
 	dprintk("%s: %s return value: %d\n", __func__, cltrack_prog, ret);
 
 	return ret;
-- 
2.25.1



More information about the Devel mailing list