[SRU][G][PATCH 8/8] UBUNTU: SAUCE: Revert "modules: mark ref_module static"

Ian May ian.may at canonical.com
Thu Jun 17 20:39:17 UTC 2021


BugLink: https://bugs.launchpad.net/bugs/1932065

This reverts commit 49ea3be5063837093b76477b67445094b0ad45ef.

Upstream introduced 'module' patches that removed exported symbols
that might cause potential disruption and breakage for customers.

Reverting as SAUCE patches to prevent regressions.

Signed-off-by: Ian May <ian.may at canonical.com>
---
 include/linux/module.h | 1 +
 kernel/module.c        | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/include/linux/module.h b/include/linux/module.h
index f1fdbeef2153..2e6670860d27 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -657,6 +657,7 @@ static inline void __module_get(struct module *module)
 #define symbol_put_addr(p) do { } while (0)
 
 #endif /* CONFIG_MODULE_UNLOAD */
+int ref_module(struct module *a, struct module *b);
 
 /* This is a #define so the string doesn't get put in every .o file */
 #define module_name(mod)			\
diff --git a/kernel/module.c b/kernel/module.c
index 41d576a23545..d619f1d5b36c 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -870,7 +870,7 @@ static int add_module_usage(struct module *a, struct module *b)
 }
 
 /* Module a uses b: caller needs module_mutex() */
-static int ref_module(struct module *a, struct module *b)
+int ref_module(struct module *a, struct module *b)
 {
 	int err;
 
@@ -889,6 +889,7 @@ static int ref_module(struct module *a, struct module *b)
 	}
 	return 0;
 }
+EXPORT_SYMBOL_GPL(ref_module);
 
 /* Clear the unload stuff of the module. */
 static void module_unload_free(struct module *mod)
@@ -1169,10 +1170,11 @@ static inline void module_unload_free(struct module *mod)
 {
 }
 
-static int ref_module(struct module *a, struct module *b)
+int ref_module(struct module *a, struct module *b)
 {
 	return strong_try_module_get(b);
 }
+EXPORT_SYMBOL_GPL(ref_module);
 
 static inline int module_unload_init(struct module *mod)
 {
-- 
2.25.1




More information about the kernel-team mailing list