[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[dm-devel] kobject_put vs module unload
- From: Mikulas Patocka <mpatocka redhat com>
- To: Greg Kroah-Hartman <gregkh suse de>
- Cc: dm-devel redhat com, linux-kernel vger kernel org
- Subject: [dm-devel] kobject_put vs module unload
- Date: Fri, 7 Jan 2011 22:42:22 -0500 (EST)
Hi
I'm looking at some kobject problem in device mapper and I came across
this problem:
According to kobject interface specification, If we embed a kobject into
the device structure, we shouldn't free the device structure when the
device is unloaded, but we should register a "release" callback in
kobj_type that will actually free the device structure.
What happens in this scenario?:
1) someone references a device kobject
2) the device is unloaded (but the device structure is still in memory
because of that reference)
3) the driver module is unloaded
4) the reference obtained at point 1) is dropped, kobject reference count
reaches zero and the release callback is called. But that callback points
to an unloaded module and causes a crash.
How is it solved? Am I missing something?
Mikulas
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]