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]
Message-ID: <Y+qUqS323ucRFO5L@li-bb2b2a4c-3307-11b2-a85c-8fa5c3a69313.ibm.com>
Date:   Tue, 14 Feb 2023 01:21:05 +0530
From:   Ojaswin Mujoo <ojaswin@...ux.ibm.com>
To:     Kemeng Shi <shikemeng@...weicloud.com>
Cc:     tytso@....edu, adilger.kernel@...ger.ca, jack@...e.cz,
        linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 14/21] ext4: remove ac->ac_found > sbi->s_mb_min_to_scan
 dead check in ext4_mb_check_limits

On Fri, Feb 10, 2023 at 03:48:18AM +0800, Kemeng Shi wrote:
> Only call trace of ext4_mb_check_limits is as following:
> ext4_mb_complex_scan_group
> 	ext4_mb_measure_extent
> 		ext4_mb_check_limits(ac, e4b, 0);
> 	ext4_mb_check_limits(ac, e4b, 1);
> 
> If the first ac->ac_found > sbi->s_mb_max_to_scan check in
> ext4_mb_check_limits is met, we will set ac_status to
> AC_STATUS_BREAK and call ext4_mb_try_best_found to try to use
> ac->ac_b_ex.
> If ext4_mb_try_best_found successes, then block allocation finishs,
> the removed ac->ac_found > sbi->s_mb_min_to_scan check is not reachable.
> If ext4_mb_try_best_found fails, then we set EXT4_MB_HINT_FIRST and
> reset ac->ac_b_ex to retry block allocation. We will use any found
> free extent in ext4_mb_measure_extent before reach the removed
> ac->ac_found > sbi->s_mb_min_to_scan check.
> In summary, the removed ac->ac_found > sbi->s_mb_min_to_scan check is
> not reachable and we can remove that dead check.
> 
> Signed-off-by: Kemeng Shi <shikemeng@...weicloud.com>
> ---
>  fs/ext4/mballoc.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index 0fdbf16ac180..e53f84de5018 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -2039,8 +2039,7 @@ static void ext4_mb_check_limits(struct ext4_allocation_context *ac,
>  	if (bex->fe_len < gex->fe_len)
>  		return;
>  
> -	if ((finish_group || ac->ac_found > sbi->s_mb_min_to_scan)
> -			&& bex->fe_group == e4b->bd_group) {
> +	if (finish_group && bex->fe_group == e4b->bd_group) {
>  		/* recheck chunk's availability - we don't know
>  		 * when it was found (within this lock-unlock
>  		 * period or not) */
> -- 
> 2.30.0
> 
Feel free to add:

Reviewed-by: Ojaswin Mujoo <ojaswin@...ux.ibm.com> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ