Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 344840
b: refs/heads/master
c: 6d138ce
h: refs/heads/master
v: v3
  • Loading branch information
Eric Sandeen authored and Theodore Ts'o committed Nov 8, 2012
1 parent 9e239bb commit 05411eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b72f78cb63fb595af63fc781dced0a6fd354e572
refs/heads/master: 6d138ced751d4e41e02c38ad55d1b3cd2913b150
11 changes: 7 additions & 4 deletions trunk/fs/ext4/mballoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4310,8 +4310,10 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle,
repeat:
/* allocate space in core */
*errp = ext4_mb_regular_allocator(ac);
if (*errp)
if (*errp) {
ext4_discard_allocated_blocks(ac);
goto errout;
}

/* as we've just preallocated more space than
* user requested orinally, we store allocated
Expand All @@ -4333,10 +4335,10 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle,
ac->ac_b_ex.fe_len = 0;
ac->ac_status = AC_STATUS_CONTINUE;
goto repeat;
} else if (*errp)
errout:
} else if (*errp) {
ext4_discard_allocated_blocks(ac);
else {
goto errout;
} else {
block = ext4_grp_offs_to_block(sb, &ac->ac_b_ex);
ar->len = ac->ac_b_ex.fe_len;
}
Expand All @@ -4347,6 +4349,7 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle,
*errp = -ENOSPC;
}

errout:
if (*errp) {
ac->ac_b_ex.fe_len = 0;
ar->len = 0;
Expand Down

0 comments on commit 05411eb

Please sign in to comment.