ext4: make mb_check_counter per group
Make bb_check_counter per group, so each group has the same chance to be checked, which can expose errors more easily. Signed-off-by: Chunguang Xu <brookxu@tencent.com> Link: https://lore.kernel.org/r/1601292995-32205-2-git-send-email-brookxu@tencent.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
This commit is contained in:
parent
9d1f9b2770
commit
addd752cff
@ -3154,6 +3154,9 @@ int ext4_update_disksize_before_punch(struct inode *inode, loff_t offset,
|
|||||||
|
|
||||||
struct ext4_group_info {
|
struct ext4_group_info {
|
||||||
unsigned long bb_state;
|
unsigned long bb_state;
|
||||||
|
#ifdef AGGRESSIVE_CHECK
|
||||||
|
unsigned long bb_check_counter;
|
||||||
|
#endif
|
||||||
struct rb_root bb_free_root;
|
struct rb_root bb_free_root;
|
||||||
ext4_grpblk_t bb_first_free; /* first free block */
|
ext4_grpblk_t bb_first_free; /* first free block */
|
||||||
ext4_grpblk_t bb_free; /* total free blocks */
|
ext4_grpblk_t bb_free; /* total free blocks */
|
||||||
|
@ -619,11 +619,8 @@ static int __mb_check_buddy(struct ext4_buddy *e4b, char *file,
|
|||||||
void *buddy;
|
void *buddy;
|
||||||
void *buddy2;
|
void *buddy2;
|
||||||
|
|
||||||
{
|
if (e4b->bd_info->bb_check_counter++ % 10)
|
||||||
static int mb_check_counter;
|
return 0;
|
||||||
if (mb_check_counter++ % 100 != 0)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
while (order > 1) {
|
while (order > 1) {
|
||||||
buddy = mb_find_buddy(e4b, order, &max);
|
buddy = mb_find_buddy(e4b, order, &max);
|
||||||
|
Loading…
Reference in New Issue
Block a user