linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] NFSv4.0 encode nconnect-enabled client into clientid
@ 2020-01-31 16:57 Olga Kornievskaia
  2020-01-31 17:09 ` Chuck Lever
  0 siblings, 1 reply; 7+ messages in thread
From: Olga Kornievskaia @ 2020-01-31 16:57 UTC (permalink / raw)
  To: trond.myklebust, anna.schumaker; +Cc: linux-nfs

From: Olga Kornievskaia <kolga@netapp.com>

It helps some servers to be able to identify if the incoming client is
doing nconnect mount or not. While creating the unique client id for
the SETCLIENTID operation add nconnect=X to it.

Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
---
 fs/nfs/nfs4proc.c | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 402410c..a90ea28 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -5950,7 +5950,7 @@ static void nfs4_init_boot_verifier(const struct nfs_client *clp,
 		return 0;
 
 	rcu_read_lock();
-	len = 14 +
+	len = 14 + 12 +
 		strlen(clp->cl_rpcclient->cl_nodename) +
 		1 +
 		strlen(rpc_peeraddr2str(clp->cl_rpcclient, RPC_DISPLAY_ADDR)) +
@@ -5972,13 +5972,15 @@ static void nfs4_init_boot_verifier(const struct nfs_client *clp,
 
 	rcu_read_lock();
 	if (nfs4_client_id_uniquifier[0] != '\0')
-		scnprintf(str, len, "Linux NFSv4.0 %s/%s/%s",
+		scnprintf(str, len, "Linux NFSv4.0 nconnect=%d %s/%s/%s",
+			  clp->cl_nconnect,
 			  clp->cl_rpcclient->cl_nodename,
 			  nfs4_client_id_uniquifier,
 			  rpc_peeraddr2str(clp->cl_rpcclient,
 					   RPC_DISPLAY_ADDR));
 	else
-		scnprintf(str, len, "Linux NFSv4.0 %s/%s",
+		scnprintf(str, len, "Linux NFSv4.0 nconnect=%d %s/%s",
+			  clp->cl_nconnect,
 			  clp->cl_rpcclient->cl_nodename,
 			  rpc_peeraddr2str(clp->cl_rpcclient,
 					   RPC_DISPLAY_ADDR));
@@ -5994,7 +5996,7 @@ static void nfs4_init_boot_verifier(const struct nfs_client *clp,
 	size_t len;
 	char *str;
 
-	len = 10 + 10 + 1 + 10 + 1 +
+	len = 10 + 10 + 1 + 10 + 1 + 12 +
 		strlen(nfs4_client_id_uniquifier) + 1 +
 		strlen(clp->cl_rpcclient->cl_nodename) + 1;
 
@@ -6010,9 +6012,9 @@ static void nfs4_init_boot_verifier(const struct nfs_client *clp,
 	if (!str)
 		return -ENOMEM;
 
-	scnprintf(str, len, "Linux NFSv%u.%u %s/%s",
+	scnprintf(str, len, "Linux NFSv%u.%u nconnect=%d %s/%s",
 			clp->rpc_ops->version, clp->cl_minorversion,
-			nfs4_client_id_uniquifier,
+			clp->cl_nconnect, nfs4_client_id_uniquifier,
 			clp->cl_rpcclient->cl_nodename);
 	clp->cl_owner_id = str;
 	return 0;
@@ -6030,7 +6032,7 @@ static void nfs4_init_boot_verifier(const struct nfs_client *clp,
 	if (nfs4_client_id_uniquifier[0] != '\0')
 		return nfs4_init_uniquifier_client_string(clp);
 
-	len = 10 + 10 + 1 + 10 + 1 +
+	len = 10 + 10 + 1 + 10 + 1 + 12 +
 		strlen(clp->cl_rpcclient->cl_nodename) + 1;
 
 	if (len > NFS4_OPAQUE_LIMIT + 1)
@@ -6045,9 +6047,9 @@ static void nfs4_init_boot_verifier(const struct nfs_client *clp,
 	if (!str)
 		return -ENOMEM;
 
-	scnprintf(str, len, "Linux NFSv%u.%u %s",
+	scnprintf(str, len, "Linux NFSv%u.%u nconnect=%d %s",
 			clp->rpc_ops->version, clp->cl_minorversion,
-			clp->cl_rpcclient->cl_nodename);
+			clp->cl_nconnect, clp->cl_rpcclient->cl_nodename);
 	clp->cl_owner_id = str;
 	return 0;
 }
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-01-31 19:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-31 16:57 [PATCH 1/1] NFSv4.0 encode nconnect-enabled client into clientid Olga Kornievskaia
2020-01-31 17:09 ` Chuck Lever
2020-01-31 17:46   ` Olga Kornievskaia
2020-01-31 18:34     ` Chuck Lever
2020-01-31 18:55       ` Olga Kornievskaia
2020-01-31 19:09         ` Chuck Lever
2020-01-31 19:46           ` Olga Kornievskaia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).