• NeilBrown's avatar
    NFS: Don't disconnect open-owner on NFS4ERR_BAD_SEQID · 86cfb041
    NeilBrown authored
    When an NFS4ERR_BAD_SEQID is received the open-owner is removed from
    the ->state_owners rbtree so that it will no longer be used.
    
    If any stateids attached to this open-owner are still in use, and if a
    request using one gets an NFS4ERR_BAD_STATEID reply, this can for bad.
    
    The state is marked as needing recovery and the nfs4_state_manager()
    is scheduled to clean up.  nfs4_state_manager() finds states to be
    recovered by walking the state_owners rbtree.  As the open-owner is
    not in the rbtree, the bad state is not found so nfs4_state_manager()
    completes having done nothing.  The request is then retried, with a
    predicatable result (indefinite retries).
    
    If the stateid is for a delegation, this open_owner will be used
    to open files when the delegation is returned.  For that to work,
    a new open-owner needs to be presented to the server.
    
    This patch changes NFS4ERR_BAD_SEQID handling to leave the open-owner
    in the rbtree but updates the 'create_time' so it looks like a new
    open-owner.  With this the indefinite retries no longer happen.
    Signed-off-by: default avatarNeilBrown <neilb@suse.com>
    Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
    86cfb041
nfs4state.c 65.8 KB