svcrdma: Select NFSv4.1 backchannel transport based on forward channel
authorChuck Lever <chuck.lever@oracle.com>
Wed, 16 Jul 2014 19:38:32 +0000 (15:38 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 18 Jul 2014 15:35:45 +0000 (11:35 -0400)
The current code always selects XPRT_TRANSPORT_BC_TCP for the back
channel, even when the forward channel was not TCP (eg, RDMA). When
a 4.1 mount is attempted with RDMA, the server panics in the TCP BC
code when trying to send CB_NULL.

Instead, construct the transport protocol number from the forward
channel transport or'd with XPRT_TRANSPORT_BC. Transports that do
not support bi-directional RPC will not have registered a "BC"
transport, causing create_backchannel_client() to fail immediately.

Fixes: https://bugzilla.linux-nfs.org/show_bug.cgi?id=265
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4callback.c
include/linux/sunrpc/svc_xprt.h
net/sunrpc/svcsock.c
net/sunrpc/xprt.c
net/sunrpc/xprtrdma/svc_rdma_transport.c

index a88a93e09d6916ba782c70540eef4c2df02c5b73..564d72304613bc23f2730eb323a699fdfcbdab11 100644 (file)
@@ -689,7 +689,8 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *c
                clp->cl_cb_session = ses;
                args.bc_xprt = conn->cb_xprt;
                args.prognumber = clp->cl_cb_session->se_cb_prog;
-               args.protocol = XPRT_TRANSPORT_BC_TCP;
+               args.protocol = conn->cb_xprt->xpt_class->xcl_ident |
+                               XPRT_TRANSPORT_BC;
                args.authflavor = ses->se_cb_sec.flavor;
        }
        /* Create RPC client */
index 7235040a19b2caecb8ea7043a1bc9cdf20535dda..5d9d6f84b38243adf1305ae2230f89515e38ed02 100644 (file)
@@ -33,6 +33,7 @@ struct svc_xprt_class {
        struct svc_xprt_ops     *xcl_ops;
        struct list_head        xcl_list;
        u32                     xcl_max_payload;
+       int                     xcl_ident;
 };
 
 /*
index b507cd327d9b802d6b6c6dba7376dee571142b47..b2437ee936572eaeac619a836c5483474fbd27a6 100644 (file)
@@ -692,6 +692,7 @@ static struct svc_xprt_class svc_udp_class = {
        .xcl_owner = THIS_MODULE,
        .xcl_ops = &svc_udp_ops,
        .xcl_max_payload = RPCSVC_MAXPAYLOAD_UDP,
+       .xcl_ident = XPRT_TRANSPORT_UDP,
 };
 
 static void svc_udp_init(struct svc_sock *svsk, struct svc_serv *serv)
@@ -1292,6 +1293,7 @@ static struct svc_xprt_class svc_tcp_class = {
        .xcl_owner = THIS_MODULE,
        .xcl_ops = &svc_tcp_ops,
        .xcl_max_payload = RPCSVC_MAXPAYLOAD_TCP,
+       .xcl_ident = XPRT_TRANSPORT_TCP,
 };
 
 void svc_init_xprt_sock(void)
index c3b2b3369e52ad48bca94f44e3d95695e7bd147d..51c63165073c08044bf94b081e3cd1f698de4e82 100644 (file)
@@ -1306,7 +1306,7 @@ struct rpc_xprt *xprt_create_transport(struct xprt_create *args)
                }
        }
        spin_unlock(&xprt_list_lock);
-       printk(KERN_ERR "RPC: transport (%d) not supported\n", args->ident);
+       dprintk("RPC: transport (%d) not supported\n", args->ident);
        return ERR_PTR(-EIO);
 
 found:
index e7323fbbd348c5e30a8a99763df73c37fa6b5a26..06a5d9235107cb1cf92efd507b391e1adc677cc9 100644 (file)
@@ -92,6 +92,7 @@ struct svc_xprt_class svc_rdma_class = {
        .xcl_owner = THIS_MODULE,
        .xcl_ops = &svc_rdma_ops,
        .xcl_max_payload = RPCSVC_MAXPAYLOAD_TCP,
+       .xcl_ident = XPRT_TRANSPORT_RDMA,
 };
 
 struct svc_rdma_op_ctxt *svc_rdma_get_context(struct svcxprt_rdma *xprt)
This page took 0.029955 seconds and 5 git commands to generate.