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: <ehghja4fxqxvc2s7popqz363bitvxvbu6sdtovetfvx6neiate@5qe4ivr7zyzs>
Date: Fri, 21 Feb 2025 18:22:01 +0800
From: Coly Li <i@...y.li>
To: Zheng Qixing <zhengqixing@...weicloud.com>
Cc: axboe@...nel.dk, song@...nel.org, colyli@...nel.org, 
	yukuai3@...wei.com, dan.j.williams@...el.com, vishal.l.verma@...el.com, 
	dave.jiang@...el.com, ira.weiny@...el.com, dlemoal@...nel.org, yanjun.zhu@...ux.dev, 
	kch@...dia.com, hare@...e.de, zhengqixing@...wei.com, john.g.garry@...cle.com, 
	geliang@...nel.org, xni@...hat.com, colyli@...e.de, linux-block@...r.kernel.org, 
	linux-kernel@...r.kernel.org, linux-raid@...r.kernel.org, nvdimm@...ts.linux.dev, 
	yi.zhang@...wei.com, yangerkun@...wei.com
Subject: Re: [PATCH 06/12] badblocks: fix the using of MAX_BADBLOCKS

On Fri, Feb 21, 2025 at 04:11:03PM +0800, Zheng Qixing wrote:
> From: Li Nan <linan122@...wei.com>
> 
> The number of badblocks cannot exceed MAX_BADBLOCKS, but it should be
> allowed to equal MAX_BADBLOCKS.
> 
> Fixes: aa511ff8218b ("badblocks: switch to the improved badblock handling code")
> Signed-off-by: Li Nan <linan122@...wei.com>

Looks good to me.

Acked-by: Coly Li <colyli@...nel.org>

Thanks.

> ---
>  block/badblocks.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/block/badblocks.c b/block/badblocks.c
> index a953d2e9417f..87267bae6836 100644
> --- a/block/badblocks.c
> +++ b/block/badblocks.c
> @@ -700,7 +700,7 @@ static bool can_front_overwrite(struct badblocks *bb, int prev,
>  			*extra = 2;
>  	}
>  
> -	if ((bb->count + (*extra)) >= MAX_BADBLOCKS)
> +	if ((bb->count + (*extra)) > MAX_BADBLOCKS)
>  		return false;
>  
>  	return true;
> @@ -1135,7 +1135,7 @@ static int _badblocks_clear(struct badblocks *bb, sector_t s, int sectors)
>  		if ((BB_OFFSET(p[prev]) < bad.start) &&
>  		    (BB_END(p[prev]) > (bad.start + bad.len))) {
>  			/* Splitting */
> -			if ((bb->count + 1) < MAX_BADBLOCKS) {
> +			if ((bb->count + 1) <= MAX_BADBLOCKS) {
>  				len = front_splitting_clear(bb, prev, &bad);
>  				bb->count += 1;
>  				cleared++;
> -- 
> 2.39.2
> 

-- 
Coly Li

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ