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, return 1; err_out: - ext2_error(sb, __FUNCTION__, + ext2_error(sb, __func__, "Invalid block bitmap - " "block_group = %d, block = %lu", block_group, bitmap_blk); @@ -132,7 +132,7 @@ read_block_bitmap(struct super_block *sb, unsigned int block_group) bitmap_blk = le32_to_cpu(desc->bg_block_bitmap); bh = sb_getblk(sb, bitmap_blk); if (unlikely(!bh)) { - ext2_error(sb, __FUNCTION__, + ext2_error(sb, __func__, "Cannot read block bitmap - " "block_group = %d, block_bitmap = %u", block_group, le32_to_cpu(desc->bg_block_bitmap)); @@ -143,17 +143,18 @@ read_block_bitmap(struct super_block *sb, unsigned int block_group) if (bh_submit_read(bh) < 0) { brelse(bh); - ext2_error(sb, __FUNCTION__, + ext2_error(sb, __func__, "Cannot read block bitmap - " "block_group = %d, block_bitmap = %u", block_group, le32_to_cpu(desc->bg_block_bitmap)); return NULL; } - if (!ext2_valid_block_bitmap(sb, desc, block_group, bh)) { - brelse(bh); - return NULL; - } + ext2_valid_block_bitmap(sb, desc, block_group, bh); + /* + * file system mounted not to panic on error, continue with corrupt + * bitmap + */ return bh; } @@ -245,11 +246,10 @@ restart: prev = rsv; } printk("Window map complete.\n"); - if (bad) - BUG(); + BUG_ON(bad); } #define rsv_window_dump(root, verbose) \ - __rsv_window_dump((root), (verbose), __FUNCTION__) + __rsv_window_dump((root), (verbose), __func__) #else #define rsv_window_dump(root, verbose) do {} while (0) #endif @@ -548,7 +548,7 @@ do_more: for (i = 0, group_freed = 0; i < count; i++) { if (!ext2_clear_bit_atomic(sb_bgl_lock(sbi, block_group), bit + i, bitmap_bh->b_data)) { - ext2_error(sb, __FUNCTION__, + ext2_error(sb, __func__, "bit already cleared for block %lu", block + i); } else { group_freed++; @@ -1381,7 +1381,12 @@ allocated: "Allocating block in system zone - " "blocks from "E2FSBLK", length %lu", ret_block, num); - goto out; + /* + * ext2_try_to_allocate marked the blocks we allocated as in + * use. So we may want to selectively mark some of the blocks + * as free + */ + goto retry_alloc; } performed_allocation = 1; |