• Rick Macklem's avatar
    nfscl: Fix a deadlock related to the NFSv4 clientID lock · 120b20bd
    Rick Macklem authored
    Without this patch, it is possible for a process doing an NFSv4
    Open/create of a file to block to allow another process
    to acquire the exclusive lock on the clientID when holding
    a shared lock on the clientID.  As such, both processes
    deadlock, with one wanting the exclusive lock, while the
    other holds the shared lock.  This deadlock is unlikely to occur
    unless delegations are in use on the NFSv4 mount.
    
    This patch fixes the problem by not deferring to the process
    waiting for the exclusive lock when a shared lock (reference cnt)
    is already held by the process.
    
    This problem was detected during a recent NFSv4 interoperability
    testing event held by the IETF working group.
    
    MFC after:	1 week
    120b20bd