Skip to content

kobject: avoid to cleanup kobject after module is unloaded

Ming Lei linux-scsi lkml oe-kbuild-all 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 9 repliesIn review
  2. v12 patches 12 repliesSuperseded

Changes in v2 from the cover letter

- add comment on 1st patch, suggested by Greg, 1/2
- fix build failure in case that CONFIG_MODULE is disabled, and add comment in kobj_module_callback(), 2/2

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2kobject: don't delay to cleanup module kobjectlib/kobject.c+14 -01 reply
2/2kobject: wait until kobject is cleaned up before freeing moduleinclude/linux/kobject.h lib/kobject.c+69 -08 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH V2 0/2] kobject: avoid to cleanup kobject after module is unloaded

Hello,

The 1st patch improves CONFIG_DEBUG_KOBJECT_RELEASE, so that kobject cleanup after unloading module can be triggered easily. With this patch, 'modprobe kset-example' can trigger the issue very quickly.

The 2nd patch fixes the issue of cleaning up object after module is unloaded, since kobj->ktype and related callbacks are often allocated as module static variable. We need to make sure kobject is really cleaned up before freeing module. This issue is reported by Petr Mladek.

V2:
- add comment on 1st patch, suggested by Greg, 1/2
- fix build failure in case that CONFIG_MODULE is disabled, and add comment in kobj_module_callback(), 2/2

Ming Lei (2):
kobject: don't delay to cleanup module kobject
kobject: wait until kobject is cleaned up before freeing module

 include/linux/kobject.h |  1 +
 lib/kobject.c           | 82 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 83 insertions(+)
Signature · 1 line
2.31.1