[Devel] [PATCH vz9 4/9] ve/nfsd: disable legacy recovery tracking for containers

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


From: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>

Look like the initial idea wasn't that good.
Legacy tracker is not supported in a container. But it's selected, if UMH
tracked is unaccessible. And legacy's "init" callback is always failing.
This means, that old "cld" tracker is always skipped, which is not, what
we want.
So, let's disable legacy tracker check in a container at all.

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

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

(cherry-picked from vz8 commit 8842e721373f ("ve/nfsd: disable legacy
recovery tracking for containers"))

Signed-off-by: Nikita Yushchenko <nikita.yushchenko at virtuozzo.com>
---
 fs/nfsd/nfs4recover.c | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
index c9aba04bac56..026477c1d071 100644
--- a/fs/nfsd/nfs4recover.c
+++ b/fs/nfsd/nfs4recover.c
@@ -2047,18 +2047,20 @@ nfsd4_client_tracking_init(struct net *net)
 	if (!status)
 		return status;
 
-	/*
-	 * Finally, See if the recoverydir exists and is a directory.
-	 * If it is, then use the legacy ops.
-	 */
-	nn->client_tracking_ops = &nfsd4_legacy_tracking_ops;
-	status = kern_path(nfs4_recoverydir(), LOOKUP_FOLLOW, &path);
-	if (!status) {
-		status = d_is_dir(path.dentry);
-		path_put(&path);
+	if (net_eq(net, &init_net)) {
+		/*
+		 * Finally, See if the recoverydir exists and is a directory.
+		 * If it is, then use the legacy ops.
+		 */
+		nn->client_tracking_ops = &nfsd4_legacy_tracking_ops;
+		status = kern_path(nfs4_recoverydir(), LOOKUP_FOLLOW, &path);
 		if (!status) {
-			status = -EINVAL;
-			goto out;
+			status = d_is_dir(path.dentry);
+			path_put(&path);
+			if (!status) {
+				status = -EINVAL;
+				goto out;
+			}
 		}
 	}
 
-- 
2.30.2



More information about the Devel mailing list