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: <aUAskIkCHiVmKs87@infradead.org>
Date: Mon, 15 Dec 2025 07:43:12 -0800
From: Christoph Hellwig <hch@...radead.org>
To: ziniu.wang_1@....com
Cc: axboe@...nel.dk, ulf.hansson@...aro.org, linux-block@...r.kernel.org,
	linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org,
	imx@...ts.linux.dev
Subject: Re: [PATCH v2 1/2] block: decouple secure erase size limit from
 discard size limit

> --- a/block/blk-merge.c
> +++ b/block/blk-merge.c
> @@ -169,8 +169,13 @@ struct bio *bio_split_discard(struct bio *bio, const struct queue_limits *lim,
>  
>  	granularity = max(lim->discard_granularity >> 9, 1U);
>  
> -	max_discard_sectors =
> -		min(lim->max_discard_sectors, bio_allowed_max_sectors(lim));
> +	if (bio_op(bio) == REQ_OP_SECURE_ERASE)
> +		max_discard_sectors = min(lim->max_secure_erase_sectors,
> +					  bio_allowed_max_sectors(lim));
> +	else
> +		max_discard_sectors = min(lim->max_discard_sectors,
> +					  bio_allowed_max_sectors(lim));

Please factor our a low-level helper and pass the max_sectors
as argument.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ