]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
NFSD: Reschedule CB operations when backchannel rpc_clnt is shut down
authorChuck Lever <chuck.lever@oracle.com>
Fri, 26 Jan 2024 17:45:29 +0000 (12:45 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Fri, 1 Mar 2024 14:12:12 +0000 (09:12 -0500)
commitc1ccfcf1a9bf3630fc4739713df6e62bb524c42c
tree96ce7f965de47ce5b7497d33c97a2fee5957e758
parentfe0e9580e2d4d136d40d03bcdb19a0a2b03a11d9
NFSD: Reschedule CB operations when backchannel rpc_clnt is shut down

As part of managing a client disconnect, NFSD closes down and
replaces the backchannel rpc_clnt.

If a callback operation is pending when the backchannel rpc_clnt is
shut down, currently nfsd4_run_cb_work() just discards that
callback. But there are multiple cases to deal with here:

 o The client's lease is getting destroyed. Throw the CB away.

 o The client disconnected. It might be forcing a retransmit of
   CB operations, or it could have disconnected for other reasons.
   Reschedule the CB so it is retransmitted when the client
   reconnects.

Since callback operations can now be rescheduled, ensure that
cb_ops->prepare can be called only once by moving the
cb_ops->prepare paragraph down to just before the rpc_call_async()
call.

Fixes: 2bbfed98a4d8 ("nfsd: Fix races between nfsd4_cb_release() and nfsd4_shutdown_callback()")
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4callback.c