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: <YoS+aS+BwKhAVWAr@localhost.localdomain>
Date:   Wed, 18 May 2022 11:37:45 +0200
From:   Oscar Salvador <osalvador@...e.de>
To:     Miaohe Lin <linmiaohe@...wei.com>
Cc:     akpm@...ux-foundation.org, willy@...radead.org, vbabka@...e.cz,
        dhowells@...hat.com, neilb@...e.de, apopple@...dia.com,
        david@...hat.com, surenb@...gle.com, peterx@...hat.com,
        naoya.horiguchi@....com, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 06/15] mm/swap: remove buggy cache->nr check in
 refill_swap_slots_cache

On Mon, May 09, 2022 at 09:14:07PM +0800, Miaohe Lin wrote:
> refill_swap_slots_cache is always called when cache->nr is 0. And if
> cache->nr != 0, we should return cache->nr instead of 0. So remove
> such buggy and confusing check.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>

With Andrew's ammendment:

Reviewed-by: Oscar Salvador <osalvador@...e.de>

> ---
>  mm/swap_slots.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/swap_slots.c b/mm/swap_slots.c
> index 2f877e6f87d7..2a65a89b5b4d 100644
> --- a/mm/swap_slots.c
> +++ b/mm/swap_slots.c
> @@ -258,7 +258,7 @@ void enable_swap_slots_cache(void)
>  /* called with swap slot cache's alloc lock held */
>  static int refill_swap_slots_cache(struct swap_slots_cache *cache)
>  {
> -	if (!use_swap_slot_cache || cache->nr)
> +	if (!use_swap_slot_cache)
>  		return 0;
>  
>  	cache->cur = 0;
> -- 
> 2.23.0
> 
> 

-- 
Oscar Salvador
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ