• Trond Myklebust's avatar
    pNFS: Fix a hang in nfs4_evict_inode() · f6395572
    Trond Myklebust authored
    We are not allowed to call pnfs_mark_matching_lsegs_return() without
    also holding a reference to the layout header, since doing so could lead
    to the reference count going to zero when we call
    pnfs_layout_remove_lseg(). This again can lead to a hang when we get to
    nfs4_evict_inode() and are unable to clear the layout pointer.
    
    pnfs_layout_return_unused_byserver() is guilty of this behaviour, and
    has been seen to trigger the refcount warning prior to a hang.
    
    Fixes: b6d49ecd ("NFSv4: Fix a pNFS layout related use-after-free race when freeing the inode")
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
    Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
    f6395572
pnfs.c 88.5 KB