Re: [PATCH] zsmalloc: fix zs_init cpu notifier error handling

From: Andrew Morton
Date: Tue Nov 18 2014 - 17:12:28 EST


On Fri, 14 Nov 2014 21:57:06 +0900 Sergey Senozhatsky <sergey.senozhatsky@xxxxxxxxx> wrote:

> Mahendran Ganesh reported that zpool-enabled zsmalloc should not
> call zpool_unregister_driver() from zs_init() if cpu notifier
> registration has failed, because error handling is performed
> before we register the driver via zpool_register_driver() call.
>
> Factor out cpu notifier registration and unregistration code and
> fix zs_init() error handling.


So we can now do this, yes?

--- a/mm/zsmalloc.c~mm-zsmallocc-use-__init-and-__exit
+++ a/mm/zsmalloc.c
@@ -911,7 +911,7 @@ static int zs_register_cpu_notifier(void
return notifier_to_errno(ret);
}

-static void zs_exit(void)
+static void __exit zs_exit(void)
{
#ifdef CONFIG_ZPOOL
zpool_unregister_driver(&zs_zpool_driver);
@@ -919,7 +919,7 @@ static void zs_exit(void)
zs_unregister_cpu_notifier();
}

-static int zs_init(void)
+static int __init zs_init(void)
{
int ret = zs_register_cpu_notifier();


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