This is a note to let you know that I've just added the patch titled

    staging: zsmalloc: Finish conversion to a separate module

to the 3.5-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     staging-zsmalloc-finish-conversion-to-a-separate-module.patch
and it can be found in the queue-3.5 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 069f101fa463351f528773d73b74e9b606b3f66a Mon Sep 17 00:00:00 2001
From: Ben Hutchings <[email protected]>
Date: Wed, 20 Jun 2012 02:31:11 +0100
Subject: staging: zsmalloc: Finish conversion to a separate module

From: Ben Hutchings <[email protected]>

commit 069f101fa463351f528773d73b74e9b606b3f66a upstream.

ZSMALLOC is tristate, but the code has no MODULE_LICENSE and since it
depends on GPL-only symbols it cannot be loaded as a module.  This in
turn breaks zram which now depends on it.  I assume it's meant to be
Dual BSD/GPL like the other z-stuff.

There is also no module_exit, which will make it impossible to unload.
Add the appropriate module_init and module_exit declarations suggested
by comments.

Reported-by: Christian Ohm <[email protected]>
References: http://bugs.debian.org/677273
Signed-off-by: Ben Hutchings <[email protected]>
Reviewed-by: Jonathan Nieder <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/staging/zsmalloc/zsmalloc-main.c |   33 ++++++-------------------------
 1 file changed, 7 insertions(+), 26 deletions(-)

--- a/drivers/staging/zsmalloc/zsmalloc-main.c
+++ b/drivers/staging/zsmalloc/zsmalloc-main.c
@@ -425,12 +425,6 @@ static struct page *find_get_zspage(stru
 }
 
 
-/*
- * If this becomes a separate module, register zs_init() with
- * module_init(), zs_exit with module_exit(), and remove zs_initialized
-*/
-static int zs_initialized;
-
 static int zs_cpu_notifier(struct notifier_block *nb, unsigned long action,
                                void *pcpu)
 {
@@ -489,7 +483,7 @@ fail:
 
 struct zs_pool *zs_create_pool(const char *name, gfp_t flags)
 {
-       int i, error, ovhd_size;
+       int i, ovhd_size;
        struct zs_pool *pool;
 
        if (!name)
@@ -516,28 +510,9 @@ struct zs_pool *zs_create_pool(const cha
 
        }
 
-       /*
-        * If this becomes a separate module, register zs_init with
-        * module_init, and remove this block
-       */
-       if (!zs_initialized) {
-               error = zs_init();
-               if (error)
-                       goto cleanup;
-               zs_initialized = 1;
-       }
-
        pool->flags = flags;
        pool->name = name;
 
-       error = 0; /* Success */
-
-cleanup:
-       if (error) {
-               zs_destroy_pool(pool);
-               pool = NULL;
-       }
-
        return pool;
 }
 EXPORT_SYMBOL_GPL(zs_create_pool);
@@ -753,3 +728,9 @@ u64 zs_get_total_size_bytes(struct zs_po
        return npages << PAGE_SHIFT;
 }
 EXPORT_SYMBOL_GPL(zs_get_total_size_bytes);
+
+module_init(zs_init);
+module_exit(zs_exit);
+
+MODULE_LICENSE("Dual BSD/GPL");
+MODULE_AUTHOR("Nitin Gupta <[email protected]>");


Patches currently in stable-queue which might be from [email protected] are

queue-3.5/udf-improve-table-length-check-to-avoid-possible-overflow.patch
queue-3.5/staging-zsmalloc-finish-conversion-to-a-separate-module.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to