2022-05-05 14:53:12 +03:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Olga Kornievskaia <kolga@netapp.com>
|
|
|
|
Date: Wed, 16 Mar 2022 18:24:26 -0400
|
|
|
|
Subject: [PATCH] NFSv4.1 provide mount option to toggle trunking discovery
|
|
|
|
|
|
|
|
Introduce a new mount option -- trunkdiscovery,notrunkdiscovery -- to
|
|
|
|
toggle whether or not the client will engage in actively discovery
|
|
|
|
of trunking locations.
|
|
|
|
|
|
|
|
v2 make notrunkdiscovery default
|
|
|
|
|
|
|
|
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
|
|
|
|
Fixes: 1976b2b31462 ("NFSv4.1 query for fs_location attr on a new file system")
|
|
|
|
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
|
|
|
|
(cherry picked from commit a43bf604446414103b7535f38e739b65601c4fb2)
|
|
|
|
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
|
|
|
|
---
|
|
|
|
fs/nfs/client.c | 3 ++-
|
|
|
|
fs/nfs/fs_context.c | 8 ++++++++
|
|
|
|
include/linux/nfs_fs_sb.h | 1 +
|
|
|
|
3 files changed, 11 insertions(+), 1 deletion(-)
|
|
|
|
|
|
|
|
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
|
|
|
|
index 090b16890e3d..f303e96ce165 100644
|
|
|
|
--- a/fs/nfs/client.c
|
|
|
|
+++ b/fs/nfs/client.c
|
|
|
|
@@ -861,7 +861,8 @@ int nfs_probe_fsinfo(struct nfs_server *server, struct nfs_fh *mntfh, struct nfs
|
|
|
|
}
|
|
|
|
|
|
|
|
if (clp->rpc_ops->discover_trunking != NULL &&
|
|
|
|
- (server->caps & NFS_CAP_FS_LOCATIONS)) {
|
|
|
|
+ (server->caps & NFS_CAP_FS_LOCATIONS &&
|
|
|
|
+ (server->flags & NFS_MOUNT_TRUNK_DISCOVERY))) {
|
|
|
|
error = clp->rpc_ops->discover_trunking(server, mntfh);
|
|
|
|
if (error < 0)
|
|
|
|
return error;
|
|
|
|
diff --git a/fs/nfs/fs_context.c b/fs/nfs/fs_context.c
|
2022-08-26 17:53:06 +03:00
|
|
|
index fb3cad38b149..0166370f088e 100644
|
2022-05-05 14:53:12 +03:00
|
|
|
--- a/fs/nfs/fs_context.c
|
|
|
|
+++ b/fs/nfs/fs_context.c
|
|
|
|
@@ -79,6 +79,7 @@ enum nfs_param {
|
|
|
|
Opt_source,
|
|
|
|
Opt_tcp,
|
|
|
|
Opt_timeo,
|
|
|
|
+ Opt_trunkdiscovery,
|
|
|
|
Opt_udp,
|
|
|
|
Opt_v,
|
|
|
|
Opt_vers,
|
|
|
|
@@ -179,6 +180,7 @@ static const struct fs_parameter_spec nfs_fs_parameters[] = {
|
|
|
|
fsparam_string("source", Opt_source),
|
|
|
|
fsparam_flag ("tcp", Opt_tcp),
|
|
|
|
fsparam_u32 ("timeo", Opt_timeo),
|
|
|
|
+ fsparam_flag_no("trunkdiscovery", Opt_trunkdiscovery),
|
|
|
|
fsparam_flag ("udp", Opt_udp),
|
|
|
|
fsparam_flag ("v2", Opt_v),
|
|
|
|
fsparam_flag ("v3", Opt_v),
|
|
|
|
@@ -528,6 +530,12 @@ static int nfs_fs_context_parse_param(struct fs_context *fc,
|
|
|
|
else
|
|
|
|
ctx->flags &= ~NFS_MOUNT_NOCTO;
|
|
|
|
break;
|
|
|
|
+ case Opt_trunkdiscovery:
|
|
|
|
+ if (result.negated)
|
|
|
|
+ ctx->flags &= ~NFS_MOUNT_TRUNK_DISCOVERY;
|
|
|
|
+ else
|
|
|
|
+ ctx->flags |= NFS_MOUNT_TRUNK_DISCOVERY;
|
|
|
|
+ break;
|
|
|
|
case Opt_ac:
|
|
|
|
if (result.negated)
|
|
|
|
ctx->flags |= NFS_MOUNT_NOAC;
|
|
|
|
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
|
2022-08-26 17:53:06 +03:00
|
|
|
index da9ef0ab9b4b..5336e494703b 100644
|
2022-05-05 14:53:12 +03:00
|
|
|
--- a/include/linux/nfs_fs_sb.h
|
|
|
|
+++ b/include/linux/nfs_fs_sb.h
|
|
|
|
@@ -156,6 +156,7 @@ struct nfs_server {
|
|
|
|
#define NFS_MOUNT_SOFTREVAL 0x800000
|
|
|
|
#define NFS_MOUNT_WRITE_EAGER 0x01000000
|
|
|
|
#define NFS_MOUNT_WRITE_WAIT 0x02000000
|
|
|
|
+#define NFS_MOUNT_TRUNK_DISCOVERY 0x04000000
|
|
|
|
|
|
|
|
unsigned int fattr_valid; /* Valid attributes */
|
|
|
|
unsigned int caps; /* server capabilities */
|