From 1ff28a0fbb4b5e1f783d2846777529b13cb98a03 Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Thu, 1 Aug 2013 16:36:15 +1000 Subject: [PATCH] xfs: fix dquot isolation hang The new LRU list isolation code in xfs_qm_dquot_isolate() isn't completely up to date. Firstly, it needs conversion to return enum lru_status values, not raw numbers. Secondly - most importantly - it fails to unlock the dquot and relock the LRU in the LRU_RETRY path. This leads to deadlocks in xfstests generic/232. Fix them. Signed-off-by: Dave Chinner Cc: Glauber Costa Cc: Michal Hocko Signed-off-by: Andrew Morton --- fs/xfs/xfs_qm.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c index 21d3d8dd61df..17777e161711 100644 --- a/fs/xfs/xfs_qm.c +++ b/fs/xfs/xfs_qm.c @@ -707,7 +707,7 @@ xfs_qm_dquot_isolate( trace_xfs_dqreclaim_want(dqp); list_del_init(&dqp->q_lru); XFS_STATS_DEC(xs_qm_dquot_unused); - return 0; + return LRU_REMOVED; } /* @@ -753,17 +753,19 @@ xfs_qm_dquot_isolate( XFS_STATS_DEC(xs_qm_dquot_unused); trace_xfs_dqreclaim_done(dqp); XFS_STATS_INC(xs_qm_dqreclaims); - return 0; + return LRU_REMOVED; out_miss_busy: trace_xfs_dqreclaim_busy(dqp); XFS_STATS_INC(xs_qm_dqreclaim_misses); - return 2; + return LRU_SKIP; out_unlock_dirty: trace_xfs_dqreclaim_busy(dqp); XFS_STATS_INC(xs_qm_dqreclaim_misses); - return 3; + xfs_dqunlock(dqp); + spin_lock(lru_lock); + return LRU_RETRY; } static unsigned long -- 2.39.5