Commit 220cca2a authored by Bob Peterson's avatar Bob Peterson Committed by Steven Whitehouse

GFS2: Change truncate page allocation to be GFP_NOFS

This patch changes the page allocation in gfs2_block_truncate_page
and two others to GFP_NOFS to avoid deadlock in low-memory conditions.
Signed-off-by: default avatarBob Peterson <rpeterso@redhat.com>
Signed-off-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
parent 58a7d5fb
...@@ -60,7 +60,7 @@ static int gfs2_unstuffer_page(struct gfs2_inode *ip, struct buffer_head *dibh, ...@@ -60,7 +60,7 @@ static int gfs2_unstuffer_page(struct gfs2_inode *ip, struct buffer_head *dibh,
int release = 0; int release = 0;
if (!page || page->index) { if (!page || page->index) {
page = grab_cache_page(inode->i_mapping, 0); page = find_or_create_page(inode->i_mapping, 0, GFP_NOFS);
if (!page) if (!page)
return -ENOMEM; return -ENOMEM;
release = 1; release = 1;
...@@ -930,7 +930,7 @@ static int gfs2_block_truncate_page(struct address_space *mapping, loff_t from) ...@@ -930,7 +930,7 @@ static int gfs2_block_truncate_page(struct address_space *mapping, loff_t from)
struct page *page; struct page *page;
int err; int err;
page = grab_cache_page(mapping, index); page = find_or_create_page(mapping, index, GFP_NOFS);
if (!page) if (!page)
return 0; return 0;
......
...@@ -681,7 +681,7 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc, ...@@ -681,7 +681,7 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc,
ptr = qp; ptr = qp;
nbytes = sizeof(struct gfs2_quota); nbytes = sizeof(struct gfs2_quota);
get_a_page: get_a_page:
page = grab_cache_page(mapping, index); page = find_or_create_page(mapping, index, GFP_NOFS);
if (!page) if (!page)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment