[Devel] [PATCH VZ9] nfsd: reenable legacy recovery tracking for non-root host netns
Pavel Tikhomirov
ptikhomirov at virtuozzo.com
Tue May 20 08:24:11 MSK 2025
Original patch [1] disabled it everywhere except init_net, that is not
correct as we wanted to disable it only in containers.
While on it, make overal code change more straight forward.
https://virtuozzo.atlassian.net/browse/VSTOR-97985
Fixes: e547b3205e05 ("ve/nfsd: disable legacy recovery tracking for containers") [1]
Signed-off-by: Pavel Tikhomirov <ptikhomirov at virtuozzo.com>
---
fs/nfsd/nfs4recover.c | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
index 49014214ca5c..6e0be7f2e0ff 100644
--- a/fs/nfsd/nfs4recover.c
+++ b/fs/nfsd/nfs4recover.c
@@ -2049,20 +2049,21 @@ nfsd4_client_tracking_init(struct net *net)
if (!status)
return status;
- 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 (!ve_is_super(net->owner_ve))
+ goto do_init;
+
+ /*
+ * 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 (!status) {
- status = d_is_dir(path.dentry);
- path_put(&path);
- if (!status) {
- status = -EINVAL;
- goto out;
- }
+ status = -EINVAL;
+ goto out;
}
}
--
2.49.0
More information about the Devel
mailing list