From 3944d5cafcd3b63185b9c113573712c3ee105c32 Mon Sep 17 00:00:00 2001 From: Alexey Khoroshilov Date: Mon, 1 Jul 2013 08:12:36 -0400 Subject: [PATCH] --- yaml --- r: 377626 b: refs/heads/master c: 2c00ef3ee309142041c7395f42aa1d49fc9f44b9 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ext4/mballoc.c | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 9d0b5809ea03..79a47c1a4311 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6ca792edc13c409e8d4eb9001e048264c6a2eb64 +refs/heads/master: 2c00ef3ee309142041c7395f42aa1d49fc9f44b9 diff --git a/trunk/fs/ext4/mballoc.c b/trunk/fs/ext4/mballoc.c index 1a9c22b45a01..a9ff5e5137ca 100644 --- a/trunk/fs/ext4/mballoc.c +++ b/trunk/fs/ext4/mballoc.c @@ -4406,17 +4406,20 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle, repeat: /* allocate space in core */ *errp = ext4_mb_regular_allocator(ac); - if (*errp) { - ext4_discard_allocated_blocks(ac); - goto errout; - } + if (*errp) + goto discard_and_exit; /* as we've just preallocated more space than - * user requested orinally, we store allocated + * user requested originally, we store allocated * space in a special descriptor */ if (ac->ac_status == AC_STATUS_FOUND && - ac->ac_o_ex.fe_len < ac->ac_b_ex.fe_len) - ext4_mb_new_preallocation(ac); + ac->ac_o_ex.fe_len < ac->ac_b_ex.fe_len) + *errp = ext4_mb_new_preallocation(ac); + if (*errp) { + discard_and_exit: + ext4_discard_allocated_blocks(ac); + goto errout; + } } if (likely(ac->ac_status == AC_STATUS_FOUND)) { *errp = ext4_mb_mark_diskspace_used(ac, handle, reserv_clstrs);