Skip to content

Commit 3c45ddf

Browse files
chuckleverJ. Bruce Fields
authored andcommitted
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 <[email protected]> Signed-off-by: J. Bruce Fields <[email protected]>
1 parent 5d6031c commit 3c45ddf

File tree

5 files changed

+7
-2
lines changed

5 files changed

+7
-2
lines changed

fs/nfsd/nfs4callback.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,8 @@ static int setup_callback_client(struct nfs4_client *clp, struct nfs4_cb_conn *c
689689
clp->cl_cb_session = ses;
690690
args.bc_xprt = conn->cb_xprt;
691691
args.prognumber = clp->cl_cb_session->se_cb_prog;
692-
args.protocol = XPRT_TRANSPORT_BC_TCP;
692+
args.protocol = conn->cb_xprt->xpt_class->xcl_ident |
693+
XPRT_TRANSPORT_BC;
693694
args.authflavor = ses->se_cb_sec.flavor;
694695
}
695696
/* Create RPC client */

include/linux/sunrpc/svc_xprt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ struct svc_xprt_class {
3333
struct svc_xprt_ops *xcl_ops;
3434
struct list_head xcl_list;
3535
u32 xcl_max_payload;
36+
int xcl_ident;
3637
};
3738

3839
/*

net/sunrpc/svcsock.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,7 @@ static struct svc_xprt_class svc_udp_class = {
692692
.xcl_owner = THIS_MODULE,
693693
.xcl_ops = &svc_udp_ops,
694694
.xcl_max_payload = RPCSVC_MAXPAYLOAD_UDP,
695+
.xcl_ident = XPRT_TRANSPORT_UDP,
695696
};
696697

697698
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 = {
12921293
.xcl_owner = THIS_MODULE,
12931294
.xcl_ops = &svc_tcp_ops,
12941295
.xcl_max_payload = RPCSVC_MAXPAYLOAD_TCP,
1296+
.xcl_ident = XPRT_TRANSPORT_TCP,
12951297
};
12961298

12971299
void svc_init_xprt_sock(void)

net/sunrpc/xprt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1306,7 +1306,7 @@ struct rpc_xprt *xprt_create_transport(struct xprt_create *args)
13061306
}
13071307
}
13081308
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);
13101310
return ERR_PTR(-EIO);
13111311

13121312
found:

net/sunrpc/xprtrdma/svc_rdma_transport.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ struct svc_xprt_class svc_rdma_class = {
9292
.xcl_owner = THIS_MODULE,
9393
.xcl_ops = &svc_rdma_ops,
9494
.xcl_max_payload = RPCSVC_MAXPAYLOAD_TCP,
95+
.xcl_ident = XPRT_TRANSPORT_RDMA,
9596
};
9697

9798
struct svc_rdma_op_ctxt *svc_rdma_get_context(struct svcxprt_rdma *xprt)

0 commit comments

Comments
 (0)