Skip to content

Commit 892de36

Browse files
author
Trond Myklebust
committed
SUNRPC: Ensure gss-proxy connects on setup
For reasons best known to the author, gss-proxy does not implement a NULL procedure, and returns RPC_PROC_UNAVAIL. However we still want to ensure that we connect to the service at setup time. So add a quirk-flag specially for this case. Fixes: 1d65833 ("SUNRPC: Add RPC based upcall mechanism for RPCGSS auth") Cc: stable@vger.kernel.org Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
1 parent efce2d0 commit 892de36

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

include/linux/sunrpc/clnt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ struct rpc_add_xprt_test {
160160
#define RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT (1UL << 9)
161161
#define RPC_CLNT_CREATE_SOFTERR (1UL << 10)
162162
#define RPC_CLNT_CREATE_REUSEPORT (1UL << 11)
163+
#define RPC_CLNT_CREATE_IGNORE_NULL_UNAVAIL (1UL << 12)
163164

164165
struct rpc_clnt *rpc_create(struct rpc_create_args *args);
165166
struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *,

net/sunrpc/auth_gss/gss_rpc_upcall.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static int gssp_rpc_create(struct net *net, struct rpc_clnt **_clnt)
9797
* timeout, which would result in reconnections being
9898
* done without the correct namespace:
9999
*/
100-
.flags = RPC_CLNT_CREATE_NOPING |
100+
.flags = RPC_CLNT_CREATE_IGNORE_NULL_UNAVAIL |
101101
RPC_CLNT_CREATE_NO_IDLE_TIMEOUT
102102
};
103103
struct rpc_clnt *clnt;

net/sunrpc/clnt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,9 @@ static struct rpc_clnt *rpc_create_xprt(struct rpc_create_args *args,
479479

480480
if (!(args->flags & RPC_CLNT_CREATE_NOPING)) {
481481
int err = rpc_ping(clnt);
482+
if ((args->flags & RPC_CLNT_CREATE_IGNORE_NULL_UNAVAIL) &&
483+
err == -EOPNOTSUPP)
484+
err = 0;
482485
if (err != 0) {
483486
rpc_shutdown_client(clnt);
484487
return ERR_PTR(err);

0 commit comments

Comments
 (0)