• Russell Cattelan's avatar
    [GFS2] Fix unlink deadlocks · ddee7608
    Russell Cattelan authored
    Move the glock acquisition to outside of the transactions.
    
    Lock odering must be preserved in order to prevent ABBA
    deadlocks. The current gfs2_change_nlink code would tries
    to grab the glock after having started a transaction and thus is holding
    the log lock. This is inconsistent with other code paths in
    gfs that grab the resource group glock prior to staring
    a tranactions.
    
    One problem with this fix is that the resource group
    lock is always grabbed now even if the inode still has
    ref count and can not be marked for unlink.
    Signed-off-by: default avatarRussell Cattelan <cattelan@redhat.com>
    Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
    ddee7608
ops_inode.c 26.5 KB