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: <ZaqruGVz734zjxrZ@casper.infradead.org>
Date: Fri, 19 Jan 2024 17:04:56 +0000
From: Matthew Wilcox <willy@...radead.org>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>
Cc: linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org,
	linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH] idr test suite: Remove usage of the deprecated
 ida_simple_xx() API

On Fri, Jan 19, 2024 at 05:54:44PM +0100, Christophe JAILLET wrote:
> ida_alloc() and ida_free() should be preferred to the deprecated
> ida_simple_get() and ida_simple_remove().
> 
> Note that the upper limit of ida_simple_get() is exclusive, but the one of
> ida_alloc_range()/ida_alloc_max() is inclusive. But because of the ranges
> used for the tests, there is no need to adjust them.
> 
> While at it remove some useless {}.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@...adoo.fr>
> ---
> It should be a question of weeks now before being able to remove the
> ida_simple_*() API.
> So it is time to convert the testing framework.

Oh, that's fantastic news!  Thank you for finishing off this conversion!

I don't have anything pending for the IDA/IDR/XArray right now.  Either
Andrew can grab this as a misc patch, or we can leave it for a cycle and
I'll put it in along with the removal of the rest of the simple API.  If
the former,

Acked-by: Matthew Wilcox (Oracle) <willy@...radead.org>

> ---
>  tools/testing/radix-tree/idr-test.c | 12 +++++-------
>  1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/tools/testing/radix-tree/idr-test.c b/tools/testing/radix-tree/idr-test.c
> index ca24f6839d50..bb41e93e2acd 100644
> --- a/tools/testing/radix-tree/idr-test.c
> +++ b/tools/testing/radix-tree/idr-test.c
> @@ -503,14 +503,12 @@ void ida_simple_get_remove_test(void)
>  	DEFINE_IDA(ida);
>  	unsigned long i;
>  
> -	for (i = 0; i < 10000; i++) {
> -		assert(ida_simple_get(&ida, 0, 20000, GFP_KERNEL) == i);
> -	}
> -	assert(ida_simple_get(&ida, 5, 30, GFP_KERNEL) < 0);
> +	for (i = 0; i < 10000; i++)
> +		assert(ida_alloc_max(&ida, 20000, GFP_KERNEL) == i);
> +	assert(ida_alloc_range(&ida, 5, 30, GFP_KERNEL) < 0);
>  
> -	for (i = 0; i < 10000; i++) {
> -		ida_simple_remove(&ida, i);
> -	}
> +	for (i = 0; i < 10000; i++)
> +		ida_free(&ida, i);
>  	assert(ida_is_empty(&ida));
>  
>  	ida_destroy(&ida);
> -- 
> 2.43.0
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ