Subject: Re: [PATCH 2/2] IPVS: Add genetlink interface implementation

From: Patrick McHardy <[email-masked]>
Date: Thu, 10 Jul 2008 14:15:49 +0200

Julius Volz wrote:
> On Wed, Jul 9, 2008, Patrick McHardy wrote:
>>> +static int ip_vs_genl_set_cmd(struct sk_buff *skb, struct genl_info
>>> *info)
>>> +{
>>> +       struct ip_vs_service *svc;
>>> +       struct ip_vs_service_user usvc;
>>> +       struct ip_vs_dest_user udest;
>>> +       int ret = 0, cmd, flags;
>>> +       int need_full_svc = 0, need_full_dest = 0;
>>> +
>>> +       cmd = info->genlhdr->cmd;
>>> +       flags = info->nlhdr->nlmsg_flags;
>>> +
>>> +       /* increase the module use count */
>>> +       ip_vs_use_count_inc();
>> This looks fishy - the reference probably must be taken by
>> genetlink before calling the command handler.
> 
> That would seem better, but is that possible? I took this from the
> sockopt interface. What would you generally want to do in this
> situation?

There probably should be a struct module *owner in the
ops registered with genetlink. This is necessary at
least to make sure that modules don't disappear during
dumps.