• Andreas Gruenbacher's avatar
    gfs2: Make glock lru list scanning safer · 228804a3
    Andreas Gruenbacher authored
    In __gfs2_glock_put(), remove the glock from the lru list *after*
    dropping the glock lock.  This prevents deadlocks against
    gfs2_scan_glock_lru().
    
    In gfs2_scan_glock_lru(), make sure that the glock's reference count is
    zero before moving the glock to the dispose list.  This skips glocks
    that are marked dead as well as glocks that are still in use.
    Additionally, switch to spin_trylock() as we already do in
    gfs2_dispose_glock_lru(); this alone would also be enough to prevent
    deadlocks against __gfs2_glock_put().
    Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
    228804a3
glock.c 73.3 KB