Rebase to 2.6.24-rc3
[ext4-patch-queue.git] / ext4-Return-after-ext4_error-in-case-of-failures.patch
blob33a5129e84731daf4cc921aefd9cab0318414eee
1 ext4: Return after ext4_error in case of failures
3 From: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
5 This fix some instances where we were continuing
6 after calling ext4_error. ext4_error call panic
7 only if errors=panic mount option is set. So
8 we need to make sure we return correctly after
9 ext4_error call
11 Reported by: Adrian Bunk <bunk@kernel.org>
13 Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
14 diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
15 index 9568a57..ff3428e 100644
16 --- a/fs/ext4/balloc.c
17 +++ b/fs/ext4/balloc.c
18 @@ -587,11 +587,13 @@ do_more:
19 in_range(ext4_inode_bitmap(sb, desc), block, count) ||
20 in_range(block, ext4_inode_table(sb, desc), sbi->s_itb_per_group) ||
21 in_range(block + count - 1, ext4_inode_table(sb, desc),
22 - sbi->s_itb_per_group))
23 + sbi->s_itb_per_group)) {
24 ext4_error (sb, "ext4_free_blocks",
25 "Freeing blocks in system zones - "
26 "Block = %llu, count = %lu",
27 block, count);
28 + goto error_return;
29 + }
32 * We are about to start releasing blocks in the bitmap,
33 @@ -1690,11 +1692,13 @@ allocated:
34 in_range(ret_block, ext4_inode_table(sb, gdp),
35 EXT4_SB(sb)->s_itb_per_group) ||
36 in_range(ret_block + num - 1, ext4_inode_table(sb, gdp),
37 - EXT4_SB(sb)->s_itb_per_group))
38 + EXT4_SB(sb)->s_itb_per_group)) {
39 ext4_error(sb, "ext4_new_block",
40 "Allocating block in system zone - "
41 "blocks from %llu, length %lu",
42 ret_block, num);
43 + goto out;
44 + }
46 performed_allocation = 1;