[PATCH v2] SUNRPC: Backchannel RPCs don't fail when the transport disconnects

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Suggested-by: Trond Myklebust <trondmy@xxxxxxxxxxxxxxx>
Fixes: 58255a4e3ce5 ("NFSD: NFSv4 callback client should use RPC_TASK_SOFTCONN")
Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
---
 fs/nfsd/nfs4callback.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c
index c3b11a715082..e87e16b65463 100644
--- a/fs/nfsd/nfs4callback.c
+++ b/fs/nfsd/nfs4callback.c
@@ -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);
 }
 




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux