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] [day] [month] [year] [list]
Message-Id: <C0C75F3E-F34B-4DB9-B139-C93694EF693D@dilger.ca>
Date:   Mon, 24 Aug 2020 15:34:49 -0600
From:   Andreas Dilger <adilger@...ger.ca>
To:     brookxu <brookxu.cn@...il.com>
Cc:     "Theodore Y. Ts'o" <tytso@....edu>,
        Ritesh Harjani <riteshh@...ux.ibm.com>,
        Jan Kara <jack@...e.cz>,
        Ext4 Developers List <linux-ext4@...r.kernel.org>
Subject: Re: [PATCH v5 1/2] ext4: reorganize if statement of
 ext4_mb_release_context()

On Aug 17, 2020, at 1:36 AM, brookxu <brookxu.cn@...il.com> wrote:
> 
> Reorganize the if statement of ext4_mb_release_context(), make it
> easier to read.
> 
> Signed-off-by: Chunguang Xu <brookxu@...cent.com>

Reviewed-by: Andreas Dilger <adilger@...ger.ca>

> ---
> fs/ext4/mballoc.c | 27 +++++++++++++--------------
> 1 file changed, 13 insertions(+), 14 deletions(-)
> 
> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index 70b110f..51f37f1 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -4567,20 +4567,19 @@ static int ext4_mb_release_context(struct ext4_allocation_context *ac)
> 			pa->pa_free -= ac->ac_b_ex.fe_len;
> 			pa->pa_len -= ac->ac_b_ex.fe_len;
> 			spin_unlock(&pa->pa_lock);
> -		}
> -	}
> -	if (pa) {
> -		/*
> -		 * We want to add the pa to the right bucket.
> -		 * Remove it from the list and while adding
> -		 * make sure the list to which we are adding
> -		 * doesn't grow big.
> -		 */
> -		if ((pa->pa_type == MB_GROUP_PA) && likely(pa->pa_free)) {
> -			spin_lock(pa->pa_obj_lock);
> -			list_del_rcu(&pa->pa_inode_list);
> -			spin_unlock(pa->pa_obj_lock);
> -			ext4_mb_add_n_trim(ac);
> +
> +			/*
> +			 * We want to add the pa to the right bucket.
> +			 * Remove it from the list and while adding
> +			 * make sure the list to which we are adding
> +			 * doesn't grow big.
> +			 */
> +			if (likely(pa->pa_free)) {
> +				spin_lock(pa->pa_obj_lock);
> +				list_del_rcu(&pa->pa_inode_list);
> +				spin_unlock(pa->pa_obj_lock);
> +				ext4_mb_add_n_trim(ac);
> +			}
> 		}
> 		ext4_mb_put_pa(ac, ac->ac_sb, pa);
> 	}
> --
> 1.8.3.1
> 
> 


Cheers, Andreas






Download attachment "signature.asc" of type "application/pgp-signature" (874 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ