Re: [PATCH 01/11] netlink: add reference of module in netlink_dump_start

2012-09-26 Thread Gao feng
于 2012年09月26日 15:07, Eric Dumazet 写道: > On Wed, 2012-09-26 at 12:52 +0800, Gao feng wrote: > >> +int netlink_dump_done(struct netlink_callback *cb) >> +{ >> +if (cb->module) >> +module_put(cb->module); >> +return 0; >> +} >> +EXPORT_SYMBOL(netlink_dump_done); >> + > > No need

Re: [PATCH 01/11] netlink: add reference of module in netlink_dump_start

2012-09-26 Thread Eric Dumazet
On Wed, 2012-09-26 at 12:52 +0800, Gao feng wrote: > +int netlink_dump_done(struct netlink_callback *cb) > +{ > + if (cb->module) > + module_put(cb->module); > + return 0; > +} > +EXPORT_SYMBOL(netlink_dump_done); > + No need to test cb->module being not NULL int netlink_dum

Re: [PATCH 01/11] netlink: add reference of module in netlink_dump_start

2012-09-25 Thread Steffen Klassert
On Wed, Sep 26, 2012 at 12:52:10PM +0800, Gao feng wrote: > + > int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, > const struct nlmsghdr *nlh, > struct netlink_dump_control *control) > @@ -1786,6 +1794,7 @@ int netlink_dump_start(struct sock *

Re: [PATCH 01/11] netlink: add reference of module in netlink_dump_start

2012-09-25 Thread Gao feng
于 2012年09月26日 13:41, Steffen Klassert 写道: > On Wed, Sep 26, 2012 at 12:52:10PM +0800, Gao feng wrote: >> + >> int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, >> const struct nlmsghdr *nlh, >> struct netlink_dump_control *control) >> @@ -1786,6

[PATCH 01/11] netlink: add reference of module in netlink_dump_start

2012-09-25 Thread Gao feng
I get a panic when I use ss -a and rmmod inet_diag at the same time. it's because netlink_dump use inet_diag_dump witch function belongs to module inet_diag. I search the codes and find many modules have the same problem. We need add reference of the module witch the cb->dump belongs to. since C