summaryrefslogtreecommitdiff
path: root/fs/ext3/acl.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@redhat.com>2008-03-19 17:00:49 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-03-19 18:53:36 -0700
commitc587f0c0a69227587baaa12e75815b6644457c0a (patch)
tree5ef93bd6d73fdab6084de20988b8934dbc10ae08 /fs/ext3/acl.c
parentffda6857c87fbe3ab144ff3f34b89421eed048cf (diff)
downloadlinux-3.10-c587f0c0a69227587baaa12e75815b6644457c0a.tar.gz
linux-3.10-c587f0c0a69227587baaa12e75815b6644457c0a.tar.bz2
linux-3.10-c587f0c0a69227587baaa12e75815b6644457c0a.zip
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/ext3/acl.c')
-rw-r--r--fs/ext3/acl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ext3/acl.c b/fs/ext3/acl.c
index d34e9967430..a754d184817 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)
return ERR_PTR(-EINVAL);
if (count == 0)
return NULL;
- acl = posix_acl_alloc(count, GFP_KERNEL);
+ acl = posix_acl_alloc(count, GFP_NOFS);
if (!acl)
return ERR_PTR(-ENOMEM);
for (n=0; n < count; n++) {
@@ -91,7 +91,7 @@ ext3_acl_to_disk(const struct posix_acl *acl, size_t *size)
*size = ext3_acl_size(acl->a_count);
ext_acl = kmalloc(sizeof(ext3_acl_header) + acl->a_count *
- sizeof(ext3_acl_entry), GFP_KERNEL);
+ sizeof(ext3_acl_entry), GFP_NOFS);
if (!ext_acl)
return ERR_PTR(-ENOMEM);
ext_acl->a_version = cpu_to_le32(EXT3_ACL_VERSION);
@@ -187,7 +187,7 @@ ext3_get_acl(struct inode *inode, int type)
}
retval = ext3_xattr_get(inode, name_index, "", NULL, 0);
if (retval > 0) {
- value = kmalloc(retval, GFP_KERNEL);
+ value = kmalloc(retval, GFP_NOFS);
if (!value)
return ERR_PTR(-ENOMEM);
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)
if (error)
goto cleanup;
}
- clone = posix_acl_clone(acl, GFP_KERNEL);
+ clone = posix_acl_clone(acl, GFP_NOFS);
error = -ENOMEM;
if (!clone)
goto cleanup;