]> err.no Git - linux-2.6/commitdiff
[GFS2] Fix deadlock in memory allocation
authorSteven Whitehouse <swhiteho@redhat.com>
Tue, 11 Jul 2006 13:50:54 +0000 (09:50 -0400)
committerSteven Whitehouse <swhiteho@redhat.com>
Tue, 11 Jul 2006 13:50:54 +0000 (09:50 -0400)
We must not call GFP_KERNEL memory allocations while we
are holding the log lock (read or write) since that may
trigger a log flush resulting in a deadlock.

Eventually we need to fix the locking in log.c, for now
this solves the problem at the expense of freeing up memory
as fast as we would like to. This needs to be revisited
later on.

Cc: Kevin Anderson <kanderso@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/meta_io.c

index cad44fd70d67b832d165637d9c47705d42dda6f3..42dfd32059bcf69c3384d7de21a5e370dc00a9ea 100644 (file)
@@ -75,7 +75,7 @@ struct inode *gfs2_aspace_get(struct gfs2_sbd *sdp)
 
        aspace = new_inode(sdp->sd_vfs);
        if (aspace) {
 
        aspace = new_inode(sdp->sd_vfs);
        if (aspace) {
-               mapping_set_gfp_mask(aspace->i_mapping, GFP_KERNEL);
+               mapping_set_gfp_mask(aspace->i_mapping, GFP_NOFS);
                aspace->i_mapping->a_ops = &aspace_aops;
                aspace->i_size = ~0ULL;
                aspace->u.generic_ip = NULL;
                aspace->i_mapping->a_ops = &aspace_aops;
                aspace->i_size = ~0ULL;
                aspace->u.generic_ip = NULL;