Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 1069

kernel-2.6.18-238.el5.src.rpm

From: Steven Whitehouse <swhiteho@redhat.com>
Date: Wed, 17 Feb 2010 16:35:01 -0500
Subject: [fs] gfs2: use correct GFP for alloc page on write
Message-id: <1266424501.2907.48.camel@localhost>
Patchwork-id: 23315
O-Subject: [RHEL 5.5] GFS2: Use correct GFP for alloc page on write (bz #566221)
Bugzilla: 566221
RH-Acked-by: Robert S Peterson <rpeterso@redhat.com>
RH-Acked-by: Abhijith Das <adas@redhat.com>

This patch adds a flag to the page allocation which is done in
grab_cache_page_write_begin() in order to avoid GFP_KERNEL
allocations which might otherwise follow.

The same patch has been upstream for some time now, but
somehow it got missed from RHEL5 (RHEL6 inherited it from
upstream).

Steve.

Signed-off-by: Jarod Wilson <jarod@redhat.com>

diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c
index 28ab192..538f426 100644
--- a/fs/gfs2/ops_address.c
+++ b/fs/gfs2/ops_address.c
@@ -744,6 +744,7 @@ int gfs2_write_begin(struct file *file, struct address_space *mapping,
 		goto out_trans_fail;
 
 	error = -ENOMEM;
+	flags |= AOP_FLAG_NOFS;
 	page = grab_cache_page_write_begin(mapping, index, flags);
 	*pagep = page;
 	if (unlikely(!page))