• Chuck Lever's avatar
    NFSD: Reschedule CB operations when backchannel rpc_clnt is shut down · c1ccfcf1
    Chuck Lever authored
    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: 2bbfed98 ("nfsd: Fix races between nfsd4_cb_release() and nfsd4_shutdown_callback()")
    Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
    Reviewed-by: default avatarBenjamin Coddington <bcodding@redhat.com>
    Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
    c1ccfcf1
nfs4callback.c 36.1 KB