Skip to contentSkip to conversation

sunrpc: set cl_max_connect when cloning an rpc_clnt

PATCH Applied Scott Mayhew 2 participants 4 messages Jun 1, 2022 – Jun 7, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sunrpc: set cl_max_connect when cloning an rpc_clnt

If the initial attempt at trunking detection using the krb5i auth flavor fails with -EACCES, -NFS4ERR_CLID_INUSE, or -NFS4ERR_WRONGSEC, then the NFS client tries again using auth_sys, cloning the rpc_clnt in the process. If this second attempt at trunking detection succeeds, then the resulting nfs_client->cl_rpcclient winds up having cl_max_connect=0 and subsequent attempts to add additional transport connections to the rpc_clnt will fail with a message similar to the following being logged:

[502044.312640] SUNRPC: reached max allowed number (0) did not add

transport to server: 192.168.122.3

---
 net/sunrpc/clnt.c | 1 +
 1 file changed, 1 insertion(+)
net/sunrpc/clnt.c +1 -0
index e2c6eca0271b..b6781ada3aa8 100644
@@ -651,6 +651,7 @@ static struct rpc_clnt *__rpc_clone_client(struct rpc_create_args *args,
 	new->cl_discrtry = clnt->cl_discrtry;
 	new->cl_chatty = clnt->cl_chatty;
 	new->cl_principal = clnt->cl_principal;
+	new->cl_max_connect = clnt->cl_max_connect;
 	return new;
 
 out_err:
Signature · 1 line
2.35.3
maintainer
#1 lore raw

Hi Scott,

Quoted 11 lines · Scott Mayhew

If the initial attempt at trunking detection using the krb5i auth flavor fails with -EACCES, -NFS4ERR_CLID_INUSE, or -NFS4ERR_WRONGSEC, then the NFS client tries again using auth_sys, cloning the rpc_clnt in the process. If this second attempt at trunking detection succeeds, then the resulting nfs_client->cl_rpcclient winds up having cl_max_connect=0 and subsequent attempts to add additional transport connections to the rpc_clnt will fail with a message similar to the following being logged:

[502044.312640] SUNRPC: reached max allowed number (0) did not add

transport to server: 192.168.122.3

Good catch! I was wondering if you could give me a "Fixes:" tag so it can be backported to stable?

Thanks,
Anna

Quoted 21 lines
---
 net/sunrpc/clnt.c | 1 +
 1 file changed, 1 insertion(+)
net/sunrpc/clnt.c +1 -1
index e2c6eca0271b..b6781ada3aa8 100644
@@ -651,6 +651,7 @@ static struct rpc_clnt *__rpc_clone_client(struct rpc_create_args *args,
        new->cl_discrtry = clnt->cl_discrtry;
        new->cl_chatty = clnt->cl_chatty;
        new->cl_principal = clnt->cl_principal;
+       new->cl_max_connect = clnt->cl_max_connect;
        return new;
 
 out_err:
--

2.35.3

#2 lore raw
Quoted 12 lines · Anna Schumaker

Hi Scott,

Quoted 9 lines · Scott Mayhew

If the initial attempt at trunking detection using the krb5i auth flavor fails with -EACCES, -NFS4ERR_CLID_INUSE, or -NFS4ERR_WRONGSEC, then the NFS client tries again using auth_sys, cloning the rpc_clnt in the process. If this second attempt at trunking detection succeeds, then the resulting nfs_client->cl_rpcclient winds up having cl_max_connect=0 and subsequent attempts to add additional transport connections to the rpc_clnt will fail with a message similar to the following being logged:

Quoted 5 lines
Quoted 2 lines
[502044.312640] SUNRPC: reached max allowed number (0) did not add

transport to server: 192.168.122.3

Good catch! I was wondering if you could give me a "Fixes:" tag so it can be backported to stable?

Fixes dc48e0abee24 ("SUNRPC enforce creation of no more than max_connect xprts")
Quoted 26 lines

Thanks,
Anna

Quoted 21 lines
---
 net/sunrpc/clnt.c | 1 +
 1 file changed, 1 insertion(+)
net/sunrpc/clnt.c +1 -1
index e2c6eca0271b..b6781ada3aa8 100644
@@ -651,6 +651,7 @@ static struct rpc_clnt *__rpc_clone_client(struct rpc_create_args *args,
        new->cl_discrtry = clnt->cl_discrtry;
        new->cl_chatty = clnt->cl_chatty;
        new->cl_principal = clnt->cl_principal;
+       new->cl_max_connect = clnt->cl_max_connect;
        return new;
 
 out_err:
--

2.35.3

maintainer Applied
#3 lore raw
Quoted 15 lines · Scott Mayhew
Quoted 12 lines · Anna Schumaker

Hi Scott,

Quoted 9 lines · Scott Mayhew

If the initial attempt at trunking detection using the krb5i auth flavor fails with -EACCES, -NFS4ERR_CLID_INUSE, or -NFS4ERR_WRONGSEC, then the NFS client tries again using auth_sys, cloning the rpc_clnt in the process. If this second attempt at trunking detection succeeds, then the resulting nfs_client->cl_rpcclient winds up having cl_max_connect=0 and subsequent attempts to add additional transport connections to the rpc_clnt will fail with a message similar to the following being logged:

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
[502044.312640] SUNRPC: reached max allowed number (0) did not add

transport to server: 192.168.122.3

Good catch! I was wondering if you could give me a "Fixes:" tag so it can be backported to stable?

Fixes dc48e0abee24 ("SUNRPC enforce creation of no more than max_connect xprts")

Thanks! Applied for a -rc pull request

Quoted 28 lines
Quoted 27 lines

Thanks,
Anna

Quoted 21 lines
---
 net/sunrpc/clnt.c | 1 +
 1 file changed, 1 insertion(+)
net/sunrpc/clnt.c +1 -1
index e2c6eca0271b..b6781ada3aa8 100644
@@ -651,6 +651,7 @@ static struct rpc_clnt *__rpc_clone_client(struct rpc_create_args *args,
        new->cl_discrtry = clnt->cl_discrtry;
        new->cl_chatty = clnt->cl_chatty;
        new->cl_principal = clnt->cl_principal;
+       new->cl_max_connect = clnt->cl_max_connect;
        return new;
 
 out_err:
--

2.35.3