• NeilBrown's avatar
    nfsd: handle drc over-allocation gracefully. · 7f49fd5d
    NeilBrown authored
    Currently, if there are more clients than allowed for by the
    space allocation in set_max_drc(), we fail a SESSION_CREATE
    request with NFS4ERR_DELAY.
    This means that the client retries indefinitely, which isn't
    a user-friendly response.
    
    The RFC requires NFS4ERR_NOSPC, but that would at best result in a
    clean failure on the client, which is not much more friendly.
    
    The current space allocation is a best-guess and doesn't provide any
    guarantees, we could still run out of space when trying to allocate
    drc space.
    
    So fail more gracefully - always give out at least one slot.
    If all clients used all the space in all slots, we might start getting
    memory pressure, but that is possible anyway.
    
    So ensure 'num' is always at least 1, and remove the test for it
    being zero.
    Signed-off-by: default avatarNeilBrown <neilb@suse.de>
    Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
    7f49fd5d
nfs4state.c 200 KB