lkml.org 
[lkml]   [2011]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectkobject_put vs module unload
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


\
 
 \ /
  Last update: 2011-01-08 04:45    [W:0.202 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site