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>
This commit is contained in:
committed by
Linus Torvalds
parent
ffda6857c8
commit
c587f0c0a6
@@ -728,7 +728,7 @@ ext3_xattr_block_set(handle_t *handle, struct inode *inode,
|
||||
ce = NULL;
|
||||
}
|
||||
ea_bdebug(bs->bh, "cloning");
|
||||
s->base = kmalloc(bs->bh->b_size, GFP_KERNEL);
|
||||
s->base = kmalloc(bs->bh->b_size, GFP_NOFS);
|
||||
error = -ENOMEM;
|
||||
if (s->base == NULL)
|
||||
goto cleanup;
|
||||
@@ -740,7 +740,7 @@ ext3_xattr_block_set(handle_t *handle, struct inode *inode,
|
||||
}
|
||||
} else {
|
||||
/* Allocate a buffer where we construct the new block. */
|
||||
s->base = kzalloc(sb->s_blocksize, GFP_KERNEL);
|
||||
s->base = kzalloc(sb->s_blocksize, GFP_NOFS);
|
||||
/* assert(header == s->base) */
|
||||
error = -ENOMEM;
|
||||
if (s->base == NULL)
|
||||
|
Reference in New Issue
Block a user