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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Sep 2014 23:28:37 +0000 (16:28 -0700)
commitc73df6f73c8167b9ed68d653d1a5c761c209d2b5
tree32de203ceef2bc2440be770ee8cc56e3032ec132
parentcaacbac7bf646a29049bec3d9f5fcc20c846b3b2
svcrdma: Select NFSv4.1 backchannel transport based on forward channel

commit 3c45ddf823d679a820adddd53b52c6699c9a05ac upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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