• Dave Chinner's avatar
    xfs: fix dquot shaker deadlock · 0fbca4d1
    Dave Chinner authored
    Commit 368e1361 ("xfs: remove duplicate code from dquot reclaim") fails
    to unlock the dquot freelist when the number of loop restarts is
    exceeded in xfs_qm_dqreclaim_one(). This causes hangs in memory
    reclaim.
    
    Rework the loop control logic into an unwind stack that all the
    different cases jump into. This means there is only one set of code
    that processes the loop exit criteria, and simplifies the unlocking
    of all the items from different points in the loop. It also fixes a
    double increment of the restart counter from the qi_dqlist_lock
    case.
    Reported-by: default avatarMalcolm Scott <lkml@malc.org.uk>
    Signed-off-by: default avatarDave Chinner <dchinner@redhat.com>
    Reviewed-by: default avatarAlex Elder <aelder@sgi.com>
    0fbca4d1
xfs_qm.c 59.6 KB