Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ba31603 authored by Peter Watkins's avatar Peter Watkins Committed by Ben Myers
Browse files

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: default avatarPeter Watkins <treestem@gmail.com>
Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
Signed-off-by: default avatarBen Myers <bpm@sgi.com>
parent ea562ed6
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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;
	}