Btrfs: use find_or_create_page instead of grab_cache_page
grab_cache_page will use mapping_gfp_mask(), which for all inodes is set to GFP_HIGHUSER_MOVABLE. So instead use find_or_create_page in all cases where we need GFP_NOFS so we don't deadlock. Thanks, Signed-off-by: Josef Bacik <josef@redhat.com>
This commit is contained in:
@@ -307,7 +307,7 @@ int __load_free_space_cache(struct btrfs_root *root, struct inode *inode,
|
||||
if (!num_entries && !num_bitmaps)
|
||||
break;
|
||||
|
||||
page = grab_cache_page(inode->i_mapping, index);
|
||||
page = find_or_create_page(inode->i_mapping, index, GFP_NOFS);
|
||||
if (!page)
|
||||
goto free_cache;
|
||||
|
||||
@@ -594,7 +594,7 @@ int __btrfs_write_out_cache(struct btrfs_root *root, struct inode *inode,
|
||||
* know and don't freak out.
|
||||
*/
|
||||
while (index < num_pages) {
|
||||
page = grab_cache_page(inode->i_mapping, index);
|
||||
page = find_or_create_page(inode->i_mapping, index, GFP_NOFS);
|
||||
if (!page) {
|
||||
int i;
|
||||
|
||||
|
Reference in New Issue
Block a user