public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* kobject_put vs module unload
@ 2011-01-08  3:42 Mikulas Patocka
  2011-01-08  5:56 ` Greg KH
  0 siblings, 1 reply; 8+ messages in thread
From: Mikulas Patocka @ 2011-01-08  3:42 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, dm-devel

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

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

end of thread, other threads:[~2011-01-08 23:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-08  3:42 kobject_put vs module unload Mikulas Patocka
2011-01-08  5:56 ` Greg KH
2011-01-08 13:19   ` Mikulas Patocka
2011-01-08 17:23     ` Kay Sievers
2011-01-08 18:01       ` Mikulas Patocka
2011-01-08 18:09         ` Kay Sievers
2011-01-08 18:50           ` Mikulas Patocka
2011-01-08 23:49             ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox