diff options
Diffstat (limited to 'fs/ext4/balloc.c')
-rw-r--r-- | fs/ext4/balloc.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index 6bba06b09dd1..de9459b4cb94 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c | |||
@@ -609,7 +609,9 @@ int ext4_claim_free_blocks(struct ext4_sb_info *sbi, | |||
609 | */ | 609 | */ |
610 | int ext4_should_retry_alloc(struct super_block *sb, int *retries) | 610 | int ext4_should_retry_alloc(struct super_block *sb, int *retries) |
611 | { | 611 | { |
612 | if (!ext4_has_free_blocks(EXT4_SB(sb), 1) || (*retries)++ > 3) | 612 | if (!ext4_has_free_blocks(EXT4_SB(sb), 1) || |
613 | (*retries)++ > 3 || | ||
614 | !EXT4_SB(sb)->s_journal) | ||
613 | return 0; | 615 | return 0; |
614 | 616 | ||
615 | jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id); | 617 | jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id); |
@@ -684,15 +686,15 @@ ext4_fsblk_t ext4_count_free_blocks(struct super_block *sb) | |||
684 | gdp = ext4_get_group_desc(sb, i, NULL); | 686 | gdp = ext4_get_group_desc(sb, i, NULL); |
685 | if (!gdp) | 687 | if (!gdp) |
686 | continue; | 688 | continue; |
687 | desc_count += le16_to_cpu(gdp->bg_free_blocks_count); | 689 | desc_count += ext4_free_blks_count(sb, gdp); |
688 | brelse(bitmap_bh); | 690 | brelse(bitmap_bh); |
689 | bitmap_bh = ext4_read_block_bitmap(sb, i); | 691 | bitmap_bh = ext4_read_block_bitmap(sb, i); |
690 | if (bitmap_bh == NULL) | 692 | if (bitmap_bh == NULL) |
691 | continue; | 693 | continue; |
692 | 694 | ||
693 | x = ext4_count_free(bitmap_bh, sb->s_blocksize); | 695 | x = ext4_count_free(bitmap_bh, sb->s_blocksize); |
694 | printk(KERN_DEBUG "group %lu: stored = %d, counted = %u\n", | 696 | printk(KERN_DEBUG "group %u: stored = %d, counted = %u\n", |
695 | i, le16_to_cpu(gdp->bg_free_blocks_count), x); | 697 | i, ext4_free_blks_count(sb, gdp), x); |
696 | bitmap_count += x; | 698 | bitmap_count += x; |
697 | } | 699 | } |
698 | brelse(bitmap_bh); | 700 | brelse(bitmap_bh); |