Skip to contentSkip to conversation

GFS2: Change truncate page allocation to be GFP_NOFS

PATCH New Bob Peterson 2 participants 2 messages Mar 19, 2012 – Mar 20, 2012 1 message not in the archive GFS2 file system

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 28c800d7-cfa2-4149-8437-dbd5217c5e5c@zmail12.collab.prod.int.phx2.redhat.com

#1 lore raw

PATCH 1/1 GFS2: Change truncate page allocation to be GFP_NOFS

Hi,

This patch changes the page allocation in gfs2_block_truncate_page and two others to GFP_NOFS to avoid deadlock in low-memory conditions.

Regards,

Bob Peterson
Red Hat File Systems

--

fs/gfs2/bmap.c +2 -2
index 14a7040..197c5c4 100644
@@ -60,7 +60,7 @@ static int gfs2_unstuffer_page(struct gfs2_inode *ip, struct buffer_head *dibh,
 	int release = 0;
 
 	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)
 			return -ENOMEM;
 		release = 1;
@@ -930,7 +930,7 @@ static int gfs2_block_truncate_page(struct address_space *mapping, loff_t from)
 	struct page *page;
 	int err;
 
-	page = grab_cache_page(mapping, index);
+	page = find_or_create_page(mapping, index, GFP_NOFS);
 	if (!page)
 		return 0;
 
fs/gfs2/quota.c +1 -1
index a45b21b..4856c66 100644
@@ -681,7 +681,7 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc,
 	ptr = qp;
 	nbytes = sizeof(struct gfs2_quota);
 get_a_page:
-	page = grab_cache_page(mapping, index);
+	page = find_or_create_page(mapping, index, GFP_NOFS);
 	if (!page)
 		return -ENOMEM;
 
#2 lore raw

PATCH 1/1 GFS2: Change truncate page allocation to be GFP_NOFS

Hi,

Now in the -nmw tree, just making the merge window this time,

Steve.

Quoted 48 lines · Bob Peterson

Hi,

This patch changes the page allocation in gfs2_block_truncate_page and two others to GFP_NOFS to avoid deadlock in low-memory conditions.

Regards,

Bob Peterson
Red Hat File Systems

--

fs/gfs2/bmap.c +2 -2
index 14a7040..197c5c4 100644
@@ -60,7 +60,7 @@ static int gfs2_unstuffer_page(struct gfs2_inode *ip, struct buffer_head *dibh,
 	int release = 0;
 
 	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)
 			return -ENOMEM;
 		release = 1;
@@ -930,7 +930,7 @@ static int gfs2_block_truncate_page(struct address_space *mapping, loff_t from)
 	struct page *page;
 	int err;
 
-	page = grab_cache_page(mapping, index);
+	page = find_or_create_page(mapping, index, GFP_NOFS);
 	if (!page)
 		return 0;
 
fs/gfs2/quota.c +1 -1
index a45b21b..4856c66 100644
@@ -681,7 +681,7 @@ static int gfs2_adjust_quota(struct gfs2_inode *ip, loff_t loc,
 	ptr = qp;
 	nbytes = sizeof(struct gfs2_quota);
 get_a_page:
-	page = grab_cache_page(mapping, index);
+	page = find_or_create_page(mapping, index, GFP_NOFS);
 	if (!page)
 		return -ENOMEM;