Thread (8 messages) flat view 8 messages, 4 authors, 2012-09-25

Re: [PATCH] inet_diag: make config INET_DIAG bool

From: Eric Dumazet <hidden>
Date: 2012-09-24 11:32:30

On Mon, 2012-09-24 at 18:17 +0800, Gao feng wrote:
于 2012年09月24日 17:42, Eric Dumazet 写道:
quoted
In fact I didnt fully understand the problem you try to address.

If you want to prevent module being unloaded, you need to add proper
module_get()/module_put()

So I would add a "struct module *module;" in struct sock_diag_handler
and use it appropriately.
Yes, I try to add reference of the module,but I can't find a proper
location to call module_get and module_put.

module_get should be called when userspace program use netlink to
send dump request to the kernel,and module_put should be called when
the dump is completed. I am right?

BUT the userspace program may only call netlink_sendmsg without call
netlink_recvmsg.so the reference of the module will be incorrect.
check ->dump() and ->done() methods
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help