xfs
[Top] [All Lists]

[PATCH] xfs: Fix inode buffer deadlock during memory reclaim

To: xfs@xxxxxxxxxxx
Subject: [PATCH] xfs: Fix inode buffer deadlock during memory reclaim
From: Peter Watkins <treestem@xxxxxxxxx>
Date: Tue, 17 May 2011 10:39:35 -0400
Cc: Peter Watkins <treestem@xxxxxxxxx>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer; bh=H05JyqLXBvnD1HjGqVnvV8Ke/btmOjt+zFI09WuDjo4=; b=LtTdWwCxUR8WLIYnobT/SNbuPXCcInrcowvtXlWrWPhR1vdO4v+7uuqBdyerILDYec vbmwHtAcl3dASshtwJqpqGGVHBzoHGL1wP4RxyE5fLeDaWvAnJzx7wzV0LrrV/LxtqsR djvB+jPHIWtIdl8UnUn2G89GfCC6SBaSZJEJg=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=bKLUuO/ygmJloBIgVYyda31ywRYM6qb+HPn4pDCf5KtGqf0HL9IwPHOb499ueYFuUq /w1otJyyo+S/rrcE7vOqhrA3u/l7/tnmbHZTK50mj+lS7Y2NAlu78PIcrT5SyjWie9O/ J32+oWm/AAAwQHwQGt1LyDoSUS8PnYLWWCnlU=
During reclaim under clear_inode, one thread holds the iprune_mutex while
trying to get an inode buffer lock. The other thread has the inode buffer
lock while trying to get the iprune_mutex lock.

Avoid reclaim recursing into the file system by using KM_NOFS in
xfs_trans_alloc.

Signed-off-by: Peter Watkins <treestem@xxxxxxxxx>
---
 fs/xfs/xfs_trans.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
index 7692279..f26f6d8 100644
--- a/fs/xfs/xfs_trans.c
+++ b/fs/xfs/xfs_trans.c
@@ -578,7 +578,7 @@ xfs_trans_alloc(
        uint            type)
 {
        xfs_wait_for_freeze(mp, SB_FREEZE_TRANS);
-       return _xfs_trans_alloc(mp, type, KM_SLEEP);
+       return _xfs_trans_alloc(mp, type, KM_SLEEP|KM_NOFS);
 }
 
 xfs_trans_t *
-- 
1.7.0.4

<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] xfs: Fix inode buffer deadlock during memory reclaim, Peter Watkins <=