Skip to content

Commit b8a0961

Browse files
olgakorn1amschuma-ntap
authored andcommitted
SUNRPC allow for unspecified transport time in rpc_clnt_add_xprt
If the supplied argument doesn't specify the transport type, use the type of the existing rpc clnt and its existing transport. Signed-off-by: Olga Kornievskaia <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent a8d54ba commit b8a0961

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

net/sunrpc/clnt.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2900,7 +2900,7 @@ int rpc_clnt_add_xprt(struct rpc_clnt *clnt,
29002900
unsigned long connect_timeout;
29012901
unsigned long reconnect_timeout;
29022902
unsigned char resvport, reuseport;
2903-
int ret = 0;
2903+
int ret = 0, ident;
29042904

29052905
rcu_read_lock();
29062906
xps = xprt_switch_get(rcu_dereference(clnt->cl_xpi.xpi_xpswitch));
@@ -2914,8 +2914,11 @@ int rpc_clnt_add_xprt(struct rpc_clnt *clnt,
29142914
reuseport = xprt->reuseport;
29152915
connect_timeout = xprt->connect_timeout;
29162916
reconnect_timeout = xprt->max_reconnect_timeout;
2917+
ident = xprt->xprt_class->ident;
29172918
rcu_read_unlock();
29182919

2920+
if (!xprtargs->ident)
2921+
xprtargs->ident = ident;
29192922
xprt = xprt_create_transport(xprtargs);
29202923
if (IS_ERR(xprt)) {
29212924
ret = PTR_ERR(xprt);

0 commit comments

Comments
 (0)