Skip to contentSkip to conversation

SUNRPC: Backchannel RPCs don't fail when the transport disconnects

PATCH New Chuck Lever 1 participant 1 message Apr 3, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 SUNRPC: Backchannel RPCs don't fail when the transport disconnects

Currently, when the forward channel conneciton goes away, backchannel operations are causing hard loops on the server because call_transmit_status's SOFTCONN logic ignores ENOTCONN and the backchannel Call is repeatedly retried.

Backchannel Calls instead should use RPC_TASK_NOCONNECT rather than RPC_TASK_SOFTCONN. If there is no forward connection, the server side is not capable of establishing a connection back to the client, thus that backchannel request should fail before the server attempts to send it. Commit 58255a4e3ce5 ("NFSD: NFSv4 callback client should use RPC_TASK_SOFTCONN") was merged several years before RPC_TASK_NOCONNECT was available.

Note that for NFSv4.0, a callback request on a broken connection will fail quickly, and the server should invoke nfsd4_process_cb_update() to establish a fresh callback channel.

Fixes 58255a4e3ce5 ("NFSD: NFSv4 callback client should use RPC_TASK_SOFTCONN")
---
 fs/nfsd/nfs4callback.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Here's the one-liner, just for the sake of argument.

fs/nfsd/nfs4callback.c +1 -1
index c3b11a715082..e87e16b65463 100644
@@ -1340,7 +1340,7 @@ nfsd4_run_cb_work(struct work_struct *work)
 	}
 
 	cb->cb_msg.rpc_cred = clp->cl_cb_cred;
-	rpc_call_async(clnt, &cb->cb_msg, RPC_TASK_SOFT | RPC_TASK_SOFTCONN,
+	rpc_call_async(clnt, &cb->cb_msg, RPC_TASK_SOFT | RPC_TASK_NOCONNECT,
 			cb->cb_ops ? &nfsd4_cb_ops : &nfsd4_cb_probe_ops, cb);
 }