diff mbox series

[1/4] NFS: Add a flag to tell nfs_client to set RPC_CLNT_CREATE_NOPING

Message ID 20221122203914.344894-2-tim.gardner@canonical.com
State New
Headers show
Series NFSv4.1: Don't rebind to the same source port when reconnecting to the server | expand

Commit Message

Tim Gardner Nov. 22, 2022, 8:39 p.m. UTC
From: Trond Myklebust <trond.myklebust@hammerspace.com>

BugLink: https://bugs.launchpad.net/bugs/1997488

Add a flag to tell the nfs_client it should set RPC_CLNT_CREATE_NOPING when
creating the rpc client.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
(cherry picked from commit 4b1b69cedf9de8c203101ea74510c07d428538f7)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
---
 fs/nfs/client.c           | 2 ++
 include/linux/nfs_fs_sb.h | 1 +
 2 files changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 35abe63655a9..ba9a3c2aa056 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -516,6 +516,8 @@  int nfs_create_rpc_client(struct nfs_client *clp,
 		args.flags |= RPC_CLNT_CREATE_NONPRIVPORT;
 	if (test_bit(NFS_CS_INFINITE_SLOTS, &clp->cl_flags))
 		args.flags |= RPC_CLNT_CREATE_INFINITE_SLOTS;
+	if (test_bit(NFS_CS_NOPING, &clp->cl_flags))
+		args.flags |= RPC_CLNT_CREATE_NOPING;
 
 	if (!IS_ERR(clp->cl_rpcclient))
 		return 0;
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index a87fe854f008..60cfe90d21dc 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -45,6 +45,7 @@  struct nfs_client {
 #define NFS_CS_INFINITE_SLOTS	3		/* - don't limit TCP slots */
 #define NFS_CS_NO_RETRANS_TIMEOUT	4	/* - Disable retransmit timeouts */
 #define NFS_CS_TSM_POSSIBLE	5		/* - Maybe state migration */
+#define NFS_CS_NOPING		6		/* - don't ping on connect */
 	struct sockaddr_storage	cl_addr;	/* server identifier */
 	size_t			cl_addrlen;
 	char *			cl_hostname;	/* hostname of server */