aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/quota.c
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/quota.c
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/quota.c')
-rw-r--r--fs/gfs2/quota.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index c71f781db5d7..56aaf915c59a 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -94,7 +94,7 @@ static int qd_alloc(struct gfs2_sbd *sdp, int user, u32 id,
94 struct gfs2_quota_data *qd; 94 struct gfs2_quota_data *qd;
95 int error; 95 int error;
96 96
97 qd = kzalloc(sizeof(struct gfs2_quota_data), GFP_KERNEL); 97 qd = kzalloc(sizeof(struct gfs2_quota_data), GFP_NOFS);
98 if (!qd) 98 if (!qd)
99 return -ENOMEM; 99 return -ENOMEM;
100 100
@@ -690,7 +690,7 @@ static int do_sync(unsigned int num_qd, struct gfs2_quota_data **qda)
690 gfs2_write_calc_reserv(ip, sizeof(struct gfs2_quota), 690 gfs2_write_calc_reserv(ip, sizeof(struct gfs2_quota),
691 &data_blocks, &ind_blocks); 691 &data_blocks, &ind_blocks);
692 692
693 ghs = kcalloc(num_qd, sizeof(struct gfs2_holder), GFP_KERNEL); 693 ghs = kcalloc(num_qd, sizeof(struct gfs2_holder), GFP_NOFS);
694 if (!ghs) 694 if (!ghs)
695 return -ENOMEM; 695 return -ENOMEM;
696 696
@@ -1118,12 +1118,12 @@ int gfs2_quota_init(struct gfs2_sbd *sdp)
1118 error = -ENOMEM; 1118 error = -ENOMEM;
1119 1119
1120 sdp->sd_quota_bitmap = kcalloc(sdp->sd_quota_chunks, 1120 sdp->sd_quota_bitmap = kcalloc(sdp->sd_quota_chunks,
1121 sizeof(unsigned char *), GFP_KERNEL); 1121 sizeof(unsigned char *), GFP_NOFS);
1122 if (!sdp->sd_quota_bitmap) 1122 if (!sdp->sd_quota_bitmap)
1123 return error; 1123 return error;
1124 1124
1125 for (x = 0; x < sdp->sd_quota_chunks; x++) { 1125 for (x = 0; x < sdp->sd_quota_chunks; x++) {
1126 sdp->sd_quota_bitmap[x] = kzalloc(PAGE_SIZE, GFP_KERNEL); 1126 sdp->sd_quota_bitmap[x] = kzalloc(PAGE_SIZE, GFP_NOFS);
1127 if (!sdp->sd_quota_bitmap[x]) 1127 if (!sdp->sd_quota_bitmap[x])
1128 goto fail; 1128 goto fail;
1129 } 1129 }