All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kobject: add the missing export for kobject_create()
@ 2021-08-31  6:50 Qu Wenruo
  2021-08-31  6:57 ` Greg KH
  2021-08-31  7:32 ` Nikolay Borisov
  0 siblings, 2 replies; 6+ messages in thread
From: Qu Wenruo @ 2021-08-31  6:50 UTC (permalink / raw)
  To: gregkh, rafael; +Cc: linux-btrfs

[BUG]
For any module utilizing kobject_create(), it will lead to link error:

  $ make M=fs/btrfs -j12
    CC [M]  fs/btrfs/sysfs.o
    LD [M]  fs/btrfs/btrfs.o
    MODPOST fs/btrfs/Module.symvers
  ERROR: modpost: "kobject_create" [fs/btrfs/btrfs.ko] undefined!
  make[1]: *** [scripts/Makefile.modpost:150: fs/btrfs/Module.symvers] Error 1
  make[1]: *** Deleting file 'fs/btrfs/Module.symvers'
  make: *** [Makefile:1766: modules] Error 2

[CAUSE]
It's pretty straight forward, kobject_create() doesn't have
EXPORT_SYMBOL_GPL().

[FIX]
Fix it by adding the missing EXPORT_SYMBOL_GPL().

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
A little surprised by the fact that no know even is calling
kobject_create() now.

Or should we just call kmalloc() manually then kobject_init_and_add()?
---
 lib/kobject.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/kobject.c b/lib/kobject.c
index ea53b30cf483..af308cf7dba2 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -788,6 +788,7 @@ struct kobject *kobject_create(void)
 	kobject_init(kobj, &dynamic_kobj_ktype);
 	return kobj;
 }
+EXPORT_SYMBOL_GPL(kobject_create);
 
 /**
  * kobject_create_and_add() - Create a struct kobject dynamically and
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-08-31 22:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-31  6:50 [PATCH] kobject: add the missing export for kobject_create() Qu Wenruo
2021-08-31  6:57 ` Greg KH
2021-08-31  7:53   ` Qu Wenruo
2021-08-31 20:04     ` Greg KH
2021-08-31 22:58       ` Qu Wenruo
2021-08-31  7:32 ` Nikolay Borisov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.