aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_iget.c
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 11:45:44 -0400
commit3ba316037470bbf98c8a16c2179c02794fb8862e (patch)
treecd9a68a6f7ecefc76e7e66e21fd936a60a1e2b6f /fs/xfs/xfs_iget.c
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/xfs/xfs_iget.c')
-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 7f81397eeec2..1bb4365e8c25 100644
--- a/fs/xfs/xfs_iget.c
+++ b/fs/xfs/xfs_iget.c
@@ -317,9 +317,10 @@ xfs_iget_cache_miss(
317 /* 317 /*
318 * Preload the radix tree so we can insert safely under the 318 * Preload the radix tree so we can insert safely under the
319 * write spinlock. Note that we cannot sleep inside the preload 319 * write spinlock. Note that we cannot sleep inside the preload
320 * region. 320 * region. Since we can be called from transaction context, don't
321 * recurse into the file system.
321 */ 322 */
322 if (radix_tree_preload(GFP_KERNEL)) { 323 if (radix_tree_preload(GFP_NOFS)) {
323 error = EAGAIN; 324 error = EAGAIN;
324 goto out_destroy; 325 goto out_destroy;
325 } 326 }