]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
SUNRPC: Ensure gss-proxy connects on setup
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 29 Apr 2022 16:22:10 +0000 (12:22 -0400)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 29 Apr 2022 16:29:31 +0000 (12:29 -0400)
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: 1d658336b05f ("SUNRPC: Add RPC based upcall mechanism for RPCGSS auth")
Cc: stable@vger.kernel.org
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
include/linux/sunrpc/clnt.h
net/sunrpc/auth_gss/gss_rpc_upcall.c
net/sunrpc/clnt.c

index 267b7aeaf1a690f02600876d9ab1ece501b1fbfb..db5149567305e60d4800f6e24611c882dbc53553 100644 (file)
@@ -160,6 +160,7 @@ struct rpc_add_xprt_test {
 #define RPC_CLNT_CREATE_NO_RETRANS_TIMEOUT     (1UL << 9)
 #define RPC_CLNT_CREATE_SOFTERR                (1UL << 10)
 #define RPC_CLNT_CREATE_REUSEPORT      (1UL << 11)
+#define RPC_CLNT_CREATE_IGNORE_NULL_UNAVAIL (1UL << 12)
 
 struct rpc_clnt *rpc_create(struct rpc_create_args *args);
 struct rpc_clnt        *rpc_bind_new_program(struct rpc_clnt *,
index 61c276bddaf2531c20afa9eb83261dc25c89690a..8ca1d809b78d935b27ee83e22ec7f89ec0fa3aea 100644 (file)
@@ -97,7 +97,7 @@ static int gssp_rpc_create(struct net *net, struct rpc_clnt **_clnt)
                 * timeout, which would result in reconnections being
                 * done without the correct namespace:
                 */
-               .flags          = RPC_CLNT_CREATE_NOPING |
+               .flags          = RPC_CLNT_CREATE_IGNORE_NULL_UNAVAIL |
                                  RPC_CLNT_CREATE_NO_IDLE_TIMEOUT
        };
        struct rpc_clnt *clnt;
index 98133aa54f198647d7926c571c39cea55cefb968..22c28cf43ebae3a1acc20d0004fed2ad32280bd1 100644 (file)
@@ -479,6 +479,9 @@ static struct rpc_clnt *rpc_create_xprt(struct rpc_create_args *args,
 
        if (!(args->flags & RPC_CLNT_CREATE_NOPING)) {
                int err = rpc_ping(clnt);
+               if ((args->flags & RPC_CLNT_CREATE_IGNORE_NULL_UNAVAIL) &&
+                   err == -EOPNOTSUPP)
+                       err = 0;
                if (err != 0) {
                        rpc_shutdown_client(clnt);
                        return ERR_PTR(err);