• Trond Myklebust's avatar
    NFSv4: Fix deadlock between nfs4_evict_inode() and nfs4_opendata_get_inode() · dfe1fe75
    Trond Myklebust authored
    If the inode is being evicted, but has to return a delegation first,
    then it can cause a deadlock in the corner case where the server reboots
    before the delegreturn completes, but while the call to iget5_locked() in
    nfs4_opendata_get_inode() is waiting for the inode free to complete.
    Since the open call still holds a session slot, the reboot recovery
    cannot proceed.
    
    In order to break the logjam, we can turn the delegation return into a
    privileged operation for the case where we're evicting the inode. We
    know that in that case, there can be no other state recovery operation
    that conflicts.
    Reported-by: default avatarzhangxiaoxu (A) <zhangxiaoxu5@huawei.com>
    Fixes: 5fcdfacc ("NFSv4: Return delegations synchronously in evict_inode")
    Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
    dfe1fe75
nfs4_fs.h 22.6 KB