[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Y+qUMgVKwxvAik5L@li-bb2b2a4c-3307-11b2-a85c-8fa5c3a69313.ibm.com>
Date: Tue, 14 Feb 2023 01:19:06 +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 12/21] ext4: remove unnecessary check in
ext4_mb_new_blocks
On Fri, Feb 10, 2023 at 03:48:16AM +0800, Kemeng Shi wrote:
> 1. remove unnecessary ac check:
> We always go to out tag before ac is successfully allocated, then we can
> move out tag after free of ac and remove NULL check of ac.
>
> 2. remove unnecessary *errp check:
> We always go to errout tag if *errp is non-zero, then we can move errout
> tag into error handle if *errp is non-zero.
>
> Signed-off-by: Kemeng Shi <shikemeng@...weicloud.com>
> ---
> fs/ext4/mballoc.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index 74da24c9bf14..bdabe0d81d4a 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -5641,16 +5641,15 @@ ext4_fsblk_t ext4_mb_new_blocks(handle_t *handle,
> *errp = -ENOSPC;
> }
>
> -errout:
> if (*errp) {
> +errout:
> ac->ac_b_ex.fe_len = 0;
> ar->len = 0;
> ext4_mb_show_ac(ac);
> }
> ext4_mb_release_context(ac);
> + kmem_cache_free(ext4_ac_cachep, ac);
> out:
> - if (ac)
> - kmem_cache_free(ext4_ac_cachep, ac);
> if (inquota && ar->len < inquota)
> dquot_free_block(ar->inode, EXT4_C2B(sbi, inquota - ar->len));
> if (!ar->len) {
> --
> 2.30.0
>
Feel free to add:
Reviewed-by: Ojaswin Mujoo <ojaswin@...ux.ibm.com>
Powered by blists - more mailing lists