diff mbox series

[v3,6/6] NFSv4 allow for nconnect value of trunkable transport

Message ID 20210616011013.50547-7-olga.kornievskaia@gmail.com (mailing list archive)
State New
Headers show
Series do not collapse trunkable transports | expand

Commit Message

Olga Kornievskaia June 16, 2021, 1:10 a.m. UTC
From: Olga Kornievskaia <kolga@netapp.com>

If the new mount asked for nconnect mount, then create old client
number of connections to the destination address that has been
established as the same server with trunkable address.

Signed-off-by: Olga Kornievskaia <kolga@netapp.com>

--- There might be a number of objection to this patch. One
I can think of is that this patch creates the nconnects based on
whether or not the new mount asked for nconnect instead of
unconditionally creating nconnect number of connections. The patch
still creates nconnect connections based on the original value
instead of picking the value of clp->cl_nconnect. I would have
preferred that would be done. I don't see what can be wrong with
using the new value. But I feared to go against what was objected
before. My preference would be to (1) create clp->cl_nconnect
connections or (2) not use this patch at all or (3) use as is
here (meaning at least not create extra connections unless asked
for by the mount).
 fs/nfs/nfs4client.c | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series


diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index af57332503be..50fa9d53b444 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -427,6 +427,15 @@  static void nfs4_add_trunk(struct nfs_client *clp, struct nfs_client *old)
 	rpc_clnt_add_xprt(old->cl_rpcclient, &xprt_args,
 			  rpc_clnt_test_and_add_xprt, NULL);
+	if (clp->cl_nconnect > 1) {
+		int i;
+		for (i = 0; i < old->cl_nconnect - 1; i++)
+			if (rpc_clnt_add_xprt(old->cl_rpcclient, &xprt_args,
+					      NULL, NULL) < 0)
+				break;
+	}