Sophie

Sophie

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

kernel-2.6.18-238.el5.src.rpm

From: Steven Whitehouse <swhiteho@redhat.com>
Date: Mon, 20 Oct 2008 11:15:42 +0100
Subject: [gfs2] set gfp for data mappings to GFP_NOFS
Message-id: 1224497742.3562.9.camel@localhost.localdomain
O-Subject: [RHEL 5.3] GFS2: Set gfp for data mappings to GFP_NOFS (bz #467689)
Bugzilla: 467689
RH-Acked-by: Abhijith Das <adas@redhat.com>

Since we are using a mix of upstream & slightly older code from RHEL in
GFS2, we need to set the gfp for data mappings to GFP_NOFS to avoid
a couple of places where the VFS would otherwise try and free dentries/inodes
when it is not allowed (i.e. under a glock). This is not needed upstream
since the VFS has a different ordering there and thus the problem does not
occur.

This has been tested by QE and found to solve the initially reported problem,
bz #460218 remains open to address a further issue. This fixes bz #467689,

Steve.

diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index ac69c91..c1461d5 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -191,6 +191,7 @@ struct inode *gfs2_inode_lookup(struct super_block *sb,
 	if (inode->i_state & I_NEW) {
 		struct gfs2_sbd *sdp = GFS2_SB(inode);
 		ip->i_no_formal_ino = no_formal_ino;
+		mapping_set_gfp_mask(inode->i_mapping, GFP_NOFS);
 
 		error = gfs2_glock_get(sdp, no_addr, &gfs2_inode_glops, CREATE, &ip->i_gl);
 		if (unlikely(error))