aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/mballoc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 5dcb826401bb..cde232bdaed0 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -4058,8 +4058,9 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle,
4058 4058
4059 ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS); 4059 ac = kmem_cache_alloc(ext4_ac_cachep, GFP_NOFS);
4060 if (!ac) { 4060 if (!ac) {
4061 ar->len = 0;
4061 *errp = -ENOMEM; 4062 *errp = -ENOMEM;
4062 return 0; 4063 goto out1;
4063 } 4064 }
4064 4065
4065 ext4_mb_poll_new_transaction(sb, handle); 4066 ext4_mb_poll_new_transaction(sb, handle);
@@ -4067,7 +4068,7 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle,
4067 *errp = ext4_mb_initialize_context(ac, ar); 4068 *errp = ext4_mb_initialize_context(ac, ar);
4068 if (*errp) { 4069 if (*errp) {
4069 ar->len = 0; 4070 ar->len = 0;
4070 goto out; 4071 goto out2;
4071 } 4072 }
4072 4073
4073 ac->ac_op = EXT4_MB_HISTORY_PREALLOC; 4074 ac->ac_op = EXT4_MB_HISTORY_PREALLOC;
@@ -4115,11 +4116,12 @@ repeat:
4115 4116
4116 ext4_mb_release_context(ac); 4117 ext4_mb_release_context(ac);
4117 4118
4118out: 4119out2:
4120 kmem_cache_free(ext4_ac_cachep, ac);
4121out1:
4119 if (ar->len < inquota) 4122 if (ar->len < inquota)
4120 DQUOT_FREE_BLOCK(ar->inode, inquota - ar->len); 4123 DQUOT_FREE_BLOCK(ar->inode, inquota - ar->len);
4121 4124
4122 kmem_cache_free(ext4_ac_cachep, ac);
4123 return block; 4125 return block;
4124} 4126}
4125static void ext4_mb_poll_new_transaction(struct super_block *sb, 4127static void ext4_mb_poll_new_transaction(struct super_block *sb,