diff options
Diffstat (limited to 'fs/ext2/balloc.c')
-rw-r--r-- | fs/ext2/balloc.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c index e7b2bafa1dd9..10bb02c3f25c 100644 --- a/fs/ext2/balloc.c +++ b/fs/ext2/balloc.c | |||
@@ -106,7 +106,7 @@ static int ext2_valid_block_bitmap(struct super_block *sb, | |||
106 | return 1; | 106 | return 1; |
107 | 107 | ||
108 | err_out: | 108 | err_out: |
109 | ext2_error(sb, __FUNCTION__, | 109 | ext2_error(sb, __func__, |
110 | "Invalid block bitmap - " | 110 | "Invalid block bitmap - " |
111 | "block_group = %d, block = %lu", | 111 | "block_group = %d, block = %lu", |
112 | block_group, bitmap_blk); | 112 | block_group, bitmap_blk); |
@@ -132,7 +132,7 @@ read_block_bitmap(struct super_block *sb, unsigned int block_group) | |||
132 | bitmap_blk = le32_to_cpu(desc->bg_block_bitmap); | 132 | bitmap_blk = le32_to_cpu(desc->bg_block_bitmap); |
133 | bh = sb_getblk(sb, bitmap_blk); | 133 | bh = sb_getblk(sb, bitmap_blk); |
134 | if (unlikely(!bh)) { | 134 | if (unlikely(!bh)) { |
135 | ext2_error(sb, __FUNCTION__, | 135 | ext2_error(sb, __func__, |
136 | "Cannot read block bitmap - " | 136 | "Cannot read block bitmap - " |
137 | "block_group = %d, block_bitmap = %u", | 137 | "block_group = %d, block_bitmap = %u", |
138 | block_group, le32_to_cpu(desc->bg_block_bitmap)); | 138 | block_group, le32_to_cpu(desc->bg_block_bitmap)); |
@@ -143,17 +143,18 @@ read_block_bitmap(struct super_block *sb, unsigned int block_group) | |||
143 | 143 | ||
144 | if (bh_submit_read(bh) < 0) { | 144 | if (bh_submit_read(bh) < 0) { |
145 | brelse(bh); | 145 | brelse(bh); |
146 | ext2_error(sb, __FUNCTION__, | 146 | ext2_error(sb, __func__, |
147 | "Cannot read block bitmap - " | 147 | "Cannot read block bitmap - " |
148 | "block_group = %d, block_bitmap = %u", | 148 | "block_group = %d, block_bitmap = %u", |
149 | block_group, le32_to_cpu(desc->bg_block_bitmap)); | 149 | block_group, le32_to_cpu(desc->bg_block_bitmap)); |
150 | return NULL; | 150 | return NULL; |
151 | } | 151 | } |
152 | if (!ext2_valid_block_bitmap(sb, desc, block_group, bh)) { | ||
153 | brelse(bh); | ||
154 | return NULL; | ||
155 | } | ||
156 | 152 | ||
153 | ext2_valid_block_bitmap(sb, desc, block_group, bh); | ||
154 | /* | ||
155 | * file system mounted not to panic on error, continue with corrupt | ||
156 | * bitmap | ||
157 | */ | ||
157 | return bh; | 158 | return bh; |
158 | } | 159 | } |
159 | 160 | ||
@@ -245,11 +246,10 @@ restart: | |||
245 | prev = rsv; | 246 | prev = rsv; |
246 | } | 247 | } |
247 | printk("Window map complete.\n"); | 248 | printk("Window map complete.\n"); |
248 | if (bad) | 249 | BUG_ON(bad); |
249 | BUG(); | ||
250 | } | 250 | } |
251 | #define rsv_window_dump(root, verbose) \ | 251 | #define rsv_window_dump(root, verbose) \ |
252 | __rsv_window_dump((root), (verbose), __FUNCTION__) | 252 | __rsv_window_dump((root), (verbose), __func__) |
253 | #else | 253 | #else |
254 | #define rsv_window_dump(root, verbose) do {} while (0) | 254 | #define rsv_window_dump(root, verbose) do {} while (0) |
255 | #endif | 255 | #endif |
@@ -548,7 +548,7 @@ do_more: | |||
548 | for (i = 0, group_freed = 0; i < count; i++) { | 548 | for (i = 0, group_freed = 0; i < count; i++) { |
549 | if (!ext2_clear_bit_atomic(sb_bgl_lock(sbi, block_group), | 549 | if (!ext2_clear_bit_atomic(sb_bgl_lock(sbi, block_group), |
550 | bit + i, bitmap_bh->b_data)) { | 550 | bit + i, bitmap_bh->b_data)) { |
551 | ext2_error(sb, __FUNCTION__, | 551 | ext2_error(sb, __func__, |
552 | "bit already cleared for block %lu", block + i); | 552 | "bit already cleared for block %lu", block + i); |
553 | } else { | 553 | } else { |
554 | group_freed++; | 554 | group_freed++; |
@@ -1381,7 +1381,12 @@ allocated: | |||
1381 | "Allocating block in system zone - " | 1381 | "Allocating block in system zone - " |
1382 | "blocks from "E2FSBLK", length %lu", | 1382 | "blocks from "E2FSBLK", length %lu", |
1383 | ret_block, num); | 1383 | ret_block, num); |
1384 | goto out; | 1384 | /* |
1385 | * ext2_try_to_allocate marked the blocks we allocated as in | ||
1386 | * use. So we may want to selectively mark some of the blocks | ||
1387 | * as free | ||
1388 | */ | ||
1389 | goto retry_alloc; | ||
1385 | } | 1390 | } |
1386 | 1391 | ||
1387 | performed_allocation = 1; | 1392 | performed_allocation = 1; |