summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorPeter Watkins <treestem@gmail.com>2012-05-07 16:11:37 -0400
committerBen Myers <bpm@sgi.com>2012-05-21 10:45:44 -0500
commit3ba316037470bbf98c8a16c2179c02794fb8862e (patch)
treecd9a68a6f7ecefc76e7e66e21fd936a60a1e2b6f /fs
parentea562ed6e7df5acd9392d993882c39e855099165 (diff)
xfs: fix memory reclaim deadlock on agi buffer
Note xfs_iget can be called while holding a locked agi buffer. If it goes into memory reclaim then inode teardown may try to lock the same buffer. Prevent the deadlock by calling radix_tree_preload with GFP_NOFS. Signed-off-by: Peter Watkins <treestem@gmail.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/xfs/xfs_iget.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c
index 7f81397eeec..1bb4365e8c2 100644
--- a/fs/xfs/xfs_iget.c
+++ b/fs/xfs/xfs_iget.c
@@ -317,9 +317,10 @@ xfs_iget_cache_miss(
/*
* Preload the radix tree so we can insert safely under the
* write spinlock. Note that we cannot sleep inside the preload
- * region.
+ * region. Since we can be called from transaction context, don't
+ * recurse into the file system.
*/
- if (radix_tree_preload(GFP_KERNEL)) {
+ if (radix_tree_preload(GFP_NOFS)) {
error = EAGAIN;
goto out_destroy;
}