aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@redhat.com>2008-03-19 20:00:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-03-19 21:53:36 -0400
commitc587f0c0a69227587baaa12e75815b6644457c0a (patch)
tree5ef93bd6d73fdab6084de20988b8934dbc10ae08 /fs
parentffda6857c87fbe3ab144ff3f34b89421eed048cf (diff)
ext3: fix wrong gfp type under transaction
There are several places where we make allocations with GFP_KERNEL while under a transaction, which could lead to an assertion panic or lockup if under memory pressure. This patch switches these problem areas to use GFP_NOFS to keep these problems from happening. Signed-off-by: Josef Bacik <jbacik@redhat.com> Cc: <linux-ext4@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/ext3/acl.c8
-rw-r--r--fs/ext3/resize.c4
-rw-r--r--fs/ext3/xattr.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/fs/ext3/acl.c b/fs/ext3/acl.c
index d34e9967430a..a754d1848173 100644
--- a/fs/ext3/acl.c
+++ b/fs/ext3/acl.c
@@ -37,7 +37,7 @@ ext3_acl_from_disk(const void *value, size_t size)
37 return ERR_PTR(-EINVAL); 37 return ERR_PTR(-EINVAL);
38 if (count == 0) 38 if (count == 0)
39 return NULL; 39 return NULL;
40 acl = posix_acl_alloc(count, GFP_KERNEL); 40 acl = posix_acl_alloc(count, GFP_NOFS);
41 if (!acl) 41 if (!acl)
42 return ERR_PTR(-ENOMEM); 42 return ERR_PTR(-ENOMEM);
43 for (n=0; n < count; n++) { 43 for (n=0; n < count; n++) {
@@ -91,7 +91,7 @@ ext3_acl_to_disk(const struct posix_acl *acl, size_t *size)
91 91
92 *size = ext3_acl_size(acl->a_count); 92 *size = ext3_acl_size(acl->a_count);
93 ext_acl = kmalloc(sizeof(ext3_acl_header) + acl->a_count * 93 ext_acl = kmalloc(sizeof(ext3_acl_header) + acl->a_count *
94 sizeof(ext3_acl_entry), GFP_KERNEL); 94 sizeof(ext3_acl_entry), GFP_NOFS);
95 if (!ext_acl) 95 if (!ext_acl)
96 return ERR_PTR(-ENOMEM); 96 return ERR_PTR(-ENOMEM);
97 ext_acl->a_version = cpu_to_le32(EXT3_ACL_VERSION); 97 ext_acl->a_version = cpu_to_le32(EXT3_ACL_VERSION);
@@ -187,7 +187,7 @@ ext3_get_acl(struct inode *inode, int type)
187 } 187 }
188 retval = ext3_xattr_get(inode, name_index, "", NULL, 0); 188 retval = ext3_xattr_get(inode, name_index, "", NULL, 0);
189 if (retval > 0) { 189 if (retval > 0) {
190 value = kmalloc(retval, GFP_KERNEL); 190 value = kmalloc(retval, GFP_NOFS);
191 if (!value) 191 if (!value)
192 return ERR_PTR(-ENOMEM); 192 return ERR_PTR(-ENOMEM);
193 retval = ext3_xattr_get(inode, name_index, "", value, retval); 193 retval = ext3_xattr_get(inode, name_index, "", value, retval);
@@ -335,7 +335,7 @@ ext3_init_acl(handle_t *handle, struct inode *inode, struct inode *dir)
335 if (error) 335 if (error)
336 goto cleanup; 336 goto cleanup;
337 } 337 }
338 clone = posix_acl_clone(acl, GFP_KERNEL); 338 clone = posix_acl_clone(acl, GFP_NOFS);
339 error = -ENOMEM; 339 error = -ENOMEM;
340 if (!clone) 340 if (!clone)
341 goto cleanup; 341 goto cleanup;
diff --git a/fs/ext3/resize.c b/fs/ext3/resize.c
index 9397d779c43d..0e97b6e07cb0 100644
--- a/fs/ext3/resize.c
+++ b/fs/ext3/resize.c
@@ -485,7 +485,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
485 goto exit_dindj; 485 goto exit_dindj;
486 486
487 n_group_desc = kmalloc((gdb_num + 1) * sizeof(struct buffer_head *), 487 n_group_desc = kmalloc((gdb_num + 1) * sizeof(struct buffer_head *),
488 GFP_KERNEL); 488 GFP_NOFS);
489 if (!n_group_desc) { 489 if (!n_group_desc) {
490 err = -ENOMEM; 490 err = -ENOMEM;
491 ext3_warning (sb, __FUNCTION__, 491 ext3_warning (sb, __FUNCTION__,
@@ -568,7 +568,7 @@ static int reserve_backup_gdb(handle_t *handle, struct inode *inode,
568 int res, i; 568 int res, i;
569 int err; 569 int err;
570 570
571 primary = kmalloc(reserved_gdb * sizeof(*primary), GFP_KERNEL); 571 primary = kmalloc(reserved_gdb * sizeof(*primary), GFP_NOFS);
572 if (!primary) 572 if (!primary)
573 return -ENOMEM; 573 return -ENOMEM;
574 574
diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c
index fb89c299bece..a6ea4d6a8bb2 100644
--- a/fs/ext3/xattr.c
+++ b/fs/ext3/xattr.c
@@ -728,7 +728,7 @@ ext3_xattr_block_set(handle_t *handle, struct inode *inode,
728 ce = NULL; 728 ce = NULL;
729 } 729 }
730 ea_bdebug(bs->bh, "cloning"); 730 ea_bdebug(bs->bh, "cloning");
731 s->base = kmalloc(bs->bh->b_size, GFP_KERNEL); 731 s->base = kmalloc(bs->bh->b_size, GFP_NOFS);
732 error = -ENOMEM; 732 error = -ENOMEM;
733 if (s->base == NULL) 733 if (s->base == NULL)
734 goto cleanup; 734 goto cleanup;
@@ -740,7 +740,7 @@ ext3_xattr_block_set(handle_t *handle, struct inode *inode,
740 } 740 }
741 } else { 741 } else {
742 /* Allocate a buffer where we construct the new block. */ 742 /* Allocate a buffer where we construct the new block. */
743 s->base = kzalloc(sb->s_blocksize, GFP_KERNEL); 743 s->base = kzalloc(sb->s_blocksize, GFP_NOFS);
744 /* assert(header == s->base) */ 744 /* assert(header == s->base) */
745 error = -ENOMEM; 745 error = -ENOMEM;
746 if (s->base == NULL) 746 if (s->base == NULL)