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

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


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

This reverts commit aa5d63ff550a1a26142d2534f46a5b37051e9ee4.

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 3e43cff43e17..2280dbb7fd3c 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -597,6 +597,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 4907d0b3ec71..6544c269963b 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -853,7 +853,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;
 
@@ -872,6 +872,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)
@@ -1152,10 +1153,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