mirror of https://gitee.com/openkylin/linux.git
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>
This commit is contained in:
parent
ea562ed6e7
commit
3ba3160374
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue