diff options
author | Chuck Lever <chuck.lever@oracle.com> | 2014-07-16 15:38:32 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-07-18 11:35:45 -0400 |
commit | 3c45ddf823d679a820adddd53b52c6699c9a05ac (patch) | |
tree | ca52538cb038660181621282d82cf5ff54f8d8e6 /net | |
parent | 5d6031ca742f9f07b9c9d9322538619f3bd155ac (diff) |
svcrdma: Select NFSv4.1 backchannel transport based on forward channel
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>
Diffstat (limited to 'net')
-rw-r--r-- | net/sunrpc/svcsock.c | 2 | ||||
-rw-r--r-- | net/sunrpc/xprt.c | 2 | ||||
-rw-r--r-- | net/sunrpc/xprtrdma/svc_rdma_transport.c | 1 |
3 files changed, 4 insertions, 1 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index b507cd327d9b..b2437ee93657 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -692,6 +692,7 @@ static struct svc_xprt_class svc_udp_class = { | |||
692 | .xcl_owner = THIS_MODULE, | 692 | .xcl_owner = THIS_MODULE, |
693 | .xcl_ops = &svc_udp_ops, | 693 | .xcl_ops = &svc_udp_ops, |
694 | .xcl_max_payload = RPCSVC_MAXPAYLOAD_UDP, | 694 | .xcl_max_payload = RPCSVC_MAXPAYLOAD_UDP, |
695 | .xcl_ident = XPRT_TRANSPORT_UDP, | ||
695 | }; | 696 | }; |
696 | 697 | ||
697 | static void svc_udp_init(struct svc_sock *svsk, struct svc_serv *serv) | 698 | 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 = { | |||
1292 | .xcl_owner = THIS_MODULE, | 1293 | .xcl_owner = THIS_MODULE, |
1293 | .xcl_ops = &svc_tcp_ops, | 1294 | .xcl_ops = &svc_tcp_ops, |
1294 | .xcl_max_payload = RPCSVC_MAXPAYLOAD_TCP, | 1295 | .xcl_max_payload = RPCSVC_MAXPAYLOAD_TCP, |
1296 | .xcl_ident = XPRT_TRANSPORT_TCP, | ||
1295 | }; | 1297 | }; |
1296 | 1298 | ||
1297 | void svc_init_xprt_sock(void) | 1299 | void svc_init_xprt_sock(void) |
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index c3b2b3369e52..51c63165073c 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -1306,7 +1306,7 @@ struct rpc_xprt *xprt_create_transport(struct xprt_create *args) | |||
1306 | } | 1306 | } |
1307 | } | 1307 | } |
1308 | spin_unlock(&xprt_list_lock); | 1308 | spin_unlock(&xprt_list_lock); |
1309 | printk(KERN_ERR "RPC: transport (%d) not supported\n", args->ident); | 1309 | dprintk("RPC: transport (%d) not supported\n", args->ident); |
1310 | return ERR_PTR(-EIO); | 1310 | return ERR_PTR(-EIO); |
1311 | 1311 | ||
1312 | found: | 1312 | found: |
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index e7323fbbd348..06a5d9235107 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c | |||
@@ -92,6 +92,7 @@ struct svc_xprt_class svc_rdma_class = { | |||
92 | .xcl_owner = THIS_MODULE, | 92 | .xcl_owner = THIS_MODULE, |
93 | .xcl_ops = &svc_rdma_ops, | 93 | .xcl_ops = &svc_rdma_ops, |
94 | .xcl_max_payload = RPCSVC_MAXPAYLOAD_TCP, | 94 | .xcl_max_payload = RPCSVC_MAXPAYLOAD_TCP, |
95 | .xcl_ident = XPRT_TRANSPORT_RDMA, | ||
95 | }; | 96 | }; |
96 | 97 | ||
97 | struct svc_rdma_op_ctxt *svc_rdma_get_context(struct svcxprt_rdma *xprt) | 98 | struct svc_rdma_op_ctxt *svc_rdma_get_context(struct svcxprt_rdma *xprt) |