]> git.karo-electronics.de Git - karo-tx-linux.git/commit
xfs: fix dquot shaker deadlock
authorDave Chinner <dchinner@redhat.com>
Fri, 28 Jan 2011 00:20:46 +0000 (11:20 +1100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 24 Feb 2011 22:54:27 +0000 (14:54 -0800)
commit4b4c00442a5b15db619feb2b0d0b841b5ba748d8
tree08f9ef7c82fd9389bc77a8552ae818c8abb23a26
parentadd80d75112c7884beedb9f4fe839a7399405075
xfs: fix dquot shaker deadlock

commit 0fbca4d1c3932c27c4794bf5c2b5fc961cf5a54f upstream.

Commit 368e136 ("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: Malcolm Scott <lkml@malc.org.uk>
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Alex Elder <aelder@sgi.com>
Cc: Arkadiusz Miskiewicz <a.miskiewicz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/xfs/quota/xfs_qm.c