lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 23 Oct 2020 16:58:42 -0600
From:   Andreas Dilger <adilger@...ger.ca>
To:     Chunguang Xu <brookxu.cn@...il.com>
Cc:     Ted Tso <tytso@....edu>,
        Ext4 Developers List <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH 2/8] ext4: remove redundant mb_regenerate_buddy()

On Oct 21, 2020, at 3:15 AM, Chunguang Xu <brookxu.cn@...il.com> wrote:
> 
> From: Chunguang Xu <brookxu@...cent.com>
> 
> After this patch (163a203), if an abnormal bitmap is detected, we
> will mark the group as corrupt, and we will not use this group in
> the future. Therefore, it should be meaningless to regenerate the
> buddy bitmap of this group, It might be better to delete it.
> 
> Signed-off-by: Chunguang Xu <brookxu@...cent.com>

Reviewed-by: Andreas Dilger <adilger@...ger.ca>


> ---
> fs/ext4/mballoc.c | 19 -------------------
> 1 file changed, 19 deletions(-)
> 
> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index 85abbfb..22301f3 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -822,24 +822,6 @@ void ext4_mb_generate_buddy(struct super_block *sb,
> 	spin_unlock(&sbi->s_bal_lock);
> }
> 
> -static void mb_regenerate_buddy(struct ext4_buddy *e4b)
> -{
> -	int count;
> -	int order = 1;
> -	void *buddy;
> -
> -	while ((buddy = mb_find_buddy(e4b, order++, &count))) {
> -		ext4_set_bits(buddy, 0, count);
> -	}
> -	e4b->bd_info->bb_fragments = 0;
> -	memset(e4b->bd_info->bb_counters, 0,
> -		sizeof(*e4b->bd_info->bb_counters) *
> -		(e4b->bd_sb->s_blocksize_bits + 2));
> -
> -	ext4_mb_generate_buddy(e4b->bd_sb, e4b->bd_buddy,
> -		e4b->bd_bitmap, e4b->bd_group);
> -}
> -
> /* The buddy information is attached the buddy cache inode
>  * for convenience. The information regarding each group
>  * is loaded via ext4_mb_load_buddy. The information involve
> @@ -1512,7 +1494,6 @@ static void mb_free_blocks(struct inode *inode, struct ext4_buddy *e4b,
> 				sb, e4b->bd_group,
> 				EXT4_GROUP_INFO_BBITMAP_CORRUPT);
> 		}
> -		mb_regenerate_buddy(e4b);
> 		goto done;
> 	}
> 
> --
> 1.8.3.1
> 


Cheers, Andreas






Download attachment "signature.asc" of type "application/pgp-signature" (874 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ