Hi Thomas,

On Fri, 13 Jan 2006, Thomas Graf wrote:

> * Per Liden <[EMAIL PROTECTED]> 2006-01-13 09:27
> > Increasing the module ref count at registration will block the module from
> > ever being unloaded. In fact, genetlink should not care about the owner at
> > all. This patch removes the owner field from the struct registered with
> > genetlink.
> 
> Why shouldn't it care? When registering you hand over control of your
> family and callback structures which may not be accessed after the
> module has been unloaded.

Right, but to make sure the structure isn't accessed after the module is 
unloaded all the module has to do is to unregister it when its exit 
function is called. If the module doesn't do that, then that's a bug in 
the module which should be fixed. The genl_sem semaphore makes sure the 
module can't unregister its structure when it's actually in use (i.e. when 
a genetlink command for that family is in progress).

> If you want to have your module unloaded, unregister your family first.

No, think about it. This is exactly where the "deadlock" happens. To 
unregister your family you need to get a call on your module's exit 
function. However, that exit function will _never_ be called by the kernel 
since it will simply not allow that when the modules ref count is > 0. 
Hence, you will never be able to unload that module ever again.

/Per
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to