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:   Thu, 27 Oct 2022 14:29:34 +0800
From:   Jason Yan <yanaijie@...wei.com>
To:     Guoqing Jiang <guoqing.jiang@...ux.dev>, <tytso@....edu>,
        <adilger.kernel@...ger.ca>
CC:     <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH] ext4: make ext4_mb_initialize_context return void


On 2022/10/27 11:24, Guoqing Jiang wrote:
> Change the return type to void since it always return 0, and no need
> to do the checking in ext4_mb_new_blocks.
> 
> Signed-off-by: Guoqing Jiang <guoqing.jiang@...ux.dev>
> ---
>   fs/ext4/mballoc.c | 10 ++--------
>   1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index 9dad93059945..5b2ae37a8b80 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -5204,7 +5204,7 @@ static void ext4_mb_group_or_file(struct ext4_allocation_context *ac)
>   	mutex_lock(&ac->ac_lg->lg_mutex);
>   }
>   
> -static noinline_for_stack int
> +static noinline_for_stack void
>   ext4_mb_initialize_context(struct ext4_allocation_context *ac,
>   				struct ext4_allocation_request *ar)
>   {
> @@ -5253,8 +5253,6 @@ ext4_mb_initialize_context(struct ext4_allocation_context *ac,
>   			(unsigned) ar->lleft, (unsigned) ar->pleft,
>   			(unsigned) ar->lright, (unsigned) ar->pright,
>   			inode_is_open_for_write(ar->inode) ? "" : "non-");
> -	return 0;
> -
>   }
>   
>   static noinline_for_stack void
> @@ -5591,11 +5589,7 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle,
>   		goto out;
>   	}
>   
> -	*errp = ext4_mb_initialize_context(ac, ar);
> -	if (*errp) {
> -		ar->len = 0;
> -		goto out;
> -	}
> +	ext4_mb_initialize_context(ac, ar);

This changed the logic here slightly. *errp will not be intialized with 
zero after this change. So we need to carefully check whether this will 
cause any issues.

Thanks,
Jason

>   
>   	ac->ac_op = EXT4_MB_HISTORY_PREALLOC;
>   	seq = this_cpu_read(discard_pa_seq);
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ