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:	Fri, 14 Nov 2014 08:29:09 +0900
From:	Minchan Kim <minchan@...nel.org>
To:	Sergey Senozhatsky <sergey.senozhatsky@...il.com>
Cc:	Mahendran Ganesh <opensource.ganesh@...il.com>, ngupta@...are.org,
	ddstreet@...e.org, linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] mm/zsmalloc: avoid unregister a NOT-registered
 zsmalloc zpool driver

Hello Sergey,

On Fri, Nov 14, 2014 at 07:31:27AM +0900, Sergey Senozhatsky wrote:
> On (11/14/14 00:30), Sergey Senozhatsky wrote:
> > Factor out zsmalloc cpu notifier unregistration code and call
> > it from both zs_exit() and zs_init() error path.
> 
> I should had have a good sleep before posting this.
> shame on me!
> 
> v3
> 
> Signed-ogg-by: Sergey Senozhatsky <sergey.senozhatsky@...il.com>

Looks good to me. a nitpick.
Could you factor out cpu register part as well as cpu unregister, too?
Then, please resend it with formal description and includes reported-by.

Thanks.

> 
> ---
> 
>  mm/zsmalloc.c | 16 ++++++++++------
>  1 file changed, 10 insertions(+), 6 deletions(-)
> 
> diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
> index b3b57ef..cd4efa1 100644
> --- a/mm/zsmalloc.c
> +++ b/mm/zsmalloc.c
> @@ -881,14 +881,10 @@ static struct notifier_block zs_cpu_nb = {
>  	.notifier_call = zs_cpu_notifier
>  };
>  
> -static void zs_exit(void)
> +static void zs_unregister_cpu_notifier(void)
>  {
>  	int cpu;
>  
> -#ifdef CONFIG_ZPOOL
> -	zpool_unregister_driver(&zs_zpool_driver);
> -#endif
> -
>  	cpu_notifier_register_begin();
>  
>  	for_each_online_cpu(cpu)
> @@ -898,6 +894,14 @@ static void zs_exit(void)
>  	cpu_notifier_register_done();
>  }
>  
> +static void zs_exit(void)
> +{
> +#ifdef CONFIG_ZPOOL
> +	zpool_unregister_driver(&zs_zpool_driver);
> +#endif
> +	zs_unregister_cpu_notifier();
> +}
> +
>  static int zs_init(void)
>  {
>  	int cpu, ret;
> @@ -921,7 +925,7 @@ static int zs_init(void)
>  
>  	return 0;
>  fail:
> -	zs_exit();
> +	zs_unregister_cpu_notifier();
>  	return notifier_to_errno(ret);
>  }
>  
> 
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@...ck.org.  For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@...ck.org"> email@...ck.org </a>

-- 
Kind regards,
Minchan Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ