aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/locking
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@redhat.com>2008-04-09 09:33:41 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2008-04-10 04:55:26 -0400
commit16c5f06f15ad4e5a5d6e90b78ffb1ac14319e445 (patch)
tree84204e44e0246e9a3f4db23223a5209105fde368 /fs/gfs2/locking
parent773adff8e983cba1f5844c3be3be224ca6645f26 (diff)
[GFS2] fix GFP_KERNEL misuses
There are several places where GFP_KERNEL allocations happen under a glock, which will result in hangs if we're under memory pressure and go to re-enter the fs in order to flush stuff out. This patch changes the culprits to GFS_NOFS to keep this problem from happening. Thank you, Signed-off-by: Josef Bacik <jbacik@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/locking')
-rw-r--r--fs/gfs2/locking/dlm/lock.c4
-rw-r--r--fs/gfs2/locking/nolock/main.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/fs/gfs2/locking/dlm/lock.c b/fs/gfs2/locking/dlm/lock.c
index 53a6ab3c0919..cf7ea8abec87 100644
--- a/fs/gfs2/locking/dlm/lock.c
+++ b/fs/gfs2/locking/dlm/lock.c
@@ -165,7 +165,7 @@ static int gdlm_create_lp(struct gdlm_ls *ls, struct lm_lockname *name,
165{ 165{
166 struct gdlm_lock *lp; 166 struct gdlm_lock *lp;
167 167
168 lp = kzalloc(sizeof(struct gdlm_lock), GFP_KERNEL); 168 lp = kzalloc(sizeof(struct gdlm_lock), GFP_NOFS);
169 if (!lp) 169 if (!lp)
170 return -ENOMEM; 170 return -ENOMEM;
171 171
@@ -383,7 +383,7 @@ static int gdlm_add_lvb(struct gdlm_lock *lp)
383{ 383{
384 char *lvb; 384 char *lvb;
385 385
386 lvb = kzalloc(GDLM_LVB_SIZE, GFP_KERNEL); 386 lvb = kzalloc(GDLM_LVB_SIZE, GFP_NOFS);
387 if (!lvb) 387 if (!lvb)
388 return -ENOMEM; 388 return -ENOMEM;
389 389
diff --git a/fs/gfs2/locking/nolock/main.c b/fs/gfs2/locking/nolock/main.c
index d3b8ce6fbbe3..284a5ece8d94 100644
--- a/fs/gfs2/locking/nolock/main.c
+++ b/fs/gfs2/locking/nolock/main.c
@@ -140,7 +140,7 @@ static int nolock_hold_lvb(void *lock, char **lvbp)
140 struct nolock_lockspace *nl = lock; 140 struct nolock_lockspace *nl = lock;
141 int error = 0; 141 int error = 0;
142 142
143 *lvbp = kzalloc(nl->nl_lvb_size, GFP_KERNEL); 143 *lvbp = kzalloc(nl->nl_lvb_size, GFP_NOFS);
144 if (!*lvbp) 144 if (!*lvbp)
145 error = -ENOMEM; 145 error = -ENOMEM;
146 146