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: <51d863a4-fe0a-4a08-a3a5-dd7b402ce824@acm.org>
Date: Tue, 2 Sep 2025 09:03:08 -0700
From: Bart Van Assche <bvanassche@....org>
To: Qianfeng Rong <rongqianfeng@...o.com>, Jens Axboe <axboe@...nel.dk>,
 linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
 "Martin K . Petersen" <martin.petersen@...cle.com>
Subject: Re: [PATCH] block: use int type to store negative value

On 9/2/25 6:09 AM, Qianfeng Rong wrote:
> Change the 'ret' variable in blk_stack_limits() from unsigned int to int,
> as it needs to store negative value -1.
> 
> Storing the negative error codes in unsigned type, or performing equality
> comparisons (e.g., ret == -1), doesn't cause an issue at runtime [1] but
> can be confusing.  Additionally, assigning negative error codes to unsigned
> type may trigger a GCC warning when the -Wsign-conversion flag is enabled.
> 
> No effect on runtime.
> 
> Link: https://lore.kernel.org/all/x3wogjf6vgpkisdhg3abzrx7v7zktmdnfmqeih5kosszmagqfs@oh3qxrgzkikf/ #1
> Signed-off-by: Qianfeng Rong <rongqianfeng@...o.com>
> ---
>   block/blk-settings.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/block/blk-settings.c b/block/blk-settings.c
> index d6438e6c276d..693bc8d20acf 100644
> --- a/block/blk-settings.c
> +++ b/block/blk-settings.c
> @@ -763,7 +763,8 @@ static void blk_stack_atomic_writes_limits(struct queue_limits *t,
>   int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
>   		     sector_t start)
>   {
> -	unsigned int top, bottom, alignment, ret = 0;
> +	unsigned int top, bottom, alignment;
> +	int ret = 0;
>   
>   	t->features |= (b->features & BLK_FEAT_INHERIT_MASK);

Has it been considered to add a Fixes tag, e.g. this tag?

Fixes: fe0b393f2c0a ("block: Correct handling of bottom device misaligment")

With or without that tag:

Reviewed-by: Bart Van Assche <bvanassche@....org>





Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ