]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
xfs: fix dquot isolation hang
authorDave Chinner <david@fromorbit.com>
Thu, 18 Jul 2013 23:59:59 +0000 (09:59 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 19 Jul 2013 03:11:29 +0000 (13:11 +1000)
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 <dchinner@redhat.com>
Cc: Glauber Costa <glommer@gmail.com>
Cc: Michal Hocko <mhocko@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/xfs/xfs_qm.c

index 6c4a587aac71004d93e93532c22d4e639ee970b9..5be049d9a6bb44d5de9c612cad4935ffb20f8b5c 100644 (file)
@@ -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