@@ -564,14 +564,14 @@ static void mb_free_blocks_double(struct inode *inode, struct ext4_buddy *e4b,
564564
565565 blocknr = ext4_group_first_block_no (sb , e4b -> bd_group );
566566 blocknr += EXT4_C2B (EXT4_SB (sb ), first + i );
567+ ext4_mark_group_bitmap_corrupted (sb , e4b -> bd_group ,
568+ EXT4_GROUP_INFO_BBITMAP_CORRUPT );
567569 ext4_grp_locked_error (sb , e4b -> bd_group ,
568570 inode ? inode -> i_ino : 0 ,
569571 blocknr ,
570572 "freeing block already freed "
571573 "(bit %u)" ,
572574 first + i );
573- ext4_mark_group_bitmap_corrupted (sb , e4b -> bd_group ,
574- EXT4_GROUP_INFO_BBITMAP_CORRUPT );
575575 }
576576 mb_clear_bit (first + i , e4b -> bd_info -> bb_bitmap );
577577 }
@@ -1933,12 +1933,12 @@ static void mb_free_blocks(struct inode *inode, struct ext4_buddy *e4b,
19331933
19341934 blocknr = ext4_group_first_block_no (sb , e4b -> bd_group );
19351935 blocknr += EXT4_C2B (sbi , block );
1936+ ext4_mark_group_bitmap_corrupted (sb , e4b -> bd_group ,
1937+ EXT4_GROUP_INFO_BBITMAP_CORRUPT );
19361938 ext4_grp_locked_error (sb , e4b -> bd_group ,
19371939 inode ? inode -> i_ino : 0 , blocknr ,
19381940 "freeing already freed block (bit %u); block bitmap corrupt." ,
19391941 block );
1940- ext4_mark_group_bitmap_corrupted (sb , e4b -> bd_group ,
1941- EXT4_GROUP_INFO_BBITMAP_CORRUPT );
19421942 return ;
19431943 }
19441944
@@ -2406,12 +2406,12 @@ void ext4_mb_simple_scan_group(struct ext4_allocation_context *ac,
24062406
24072407 k = mb_find_next_zero_bit (buddy , max , 0 );
24082408 if (k >= max ) {
2409+ ext4_mark_group_bitmap_corrupted (ac -> ac_sb ,
2410+ e4b -> bd_group ,
2411+ EXT4_GROUP_INFO_BBITMAP_CORRUPT );
24092412 ext4_grp_locked_error (ac -> ac_sb , e4b -> bd_group , 0 , 0 ,
24102413 "%d free clusters of order %d. But found 0" ,
24112414 grp -> bb_counters [i ], i );
2412- ext4_mark_group_bitmap_corrupted (ac -> ac_sb ,
2413- e4b -> bd_group ,
2414- EXT4_GROUP_INFO_BBITMAP_CORRUPT );
24152415 break ;
24162416 }
24172417 ac -> ac_found ++ ;
@@ -2462,12 +2462,12 @@ void ext4_mb_complex_scan_group(struct ext4_allocation_context *ac,
24622462 * free blocks even though group info says we
24632463 * have free blocks
24642464 */
2465+ ext4_mark_group_bitmap_corrupted (sb , e4b -> bd_group ,
2466+ EXT4_GROUP_INFO_BBITMAP_CORRUPT );
24652467 ext4_grp_locked_error (sb , e4b -> bd_group , 0 , 0 ,
24662468 "%d free clusters as per "
24672469 "group info. But bitmap says 0" ,
24682470 free );
2469- ext4_mark_group_bitmap_corrupted (sb , e4b -> bd_group ,
2470- EXT4_GROUP_INFO_BBITMAP_CORRUPT );
24712471 break ;
24722472 }
24732473
@@ -2493,12 +2493,12 @@ void ext4_mb_complex_scan_group(struct ext4_allocation_context *ac,
24932493 if (WARN_ON (ex .fe_len <= 0 ))
24942494 break ;
24952495 if (free < ex .fe_len ) {
2496+ ext4_mark_group_bitmap_corrupted (sb , e4b -> bd_group ,
2497+ EXT4_GROUP_INFO_BBITMAP_CORRUPT );
24962498 ext4_grp_locked_error (sb , e4b -> bd_group , 0 , 0 ,
24972499 "%d free clusters as per "
24982500 "group info. But got %d blocks" ,
24992501 free , ex .fe_len );
2500- ext4_mark_group_bitmap_corrupted (sb , e4b -> bd_group ,
2501- EXT4_GROUP_INFO_BBITMAP_CORRUPT );
25022502 /*
25032503 * The number of free blocks differs. This mostly
25042504 * indicate that the bitmap is corrupt. So exit
0 commit comments