LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

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

To: "Patrick McHardy" <kaber@xxxxxxxxx>
Subject: Re: [PATCH 2/2] IPVS: Add genetlink interface implementation
Cc: netdev@xxxxxxxxxxxxxxx, lvs-devel@xxxxxxxxxxxxxxx, vbusam@xxxxxxxxxx, horms@xxxxxxxxxxxx, davem@xxxxxxxxxxxxx
From: "Julius Volz" <juliusv@xxxxxxxxxx>
Date: Wed, 9 Jul 2008 20:16:43 +0200
On Wed, Jul 9, 2008, Patrick McHardy wrote:
> Just a few quick comments, will try to do a full review later:

Thanks!

>> + * Policy used for commands that operate on service, destination
>> + * or daemon entries
>> + */
>> +static struct nla_policy ip_vs_entries_policy[IPVS_ENTRY_ATTR_MAX + 1]
>> +__read_mostly = {
>
> These can all be const (and have the __read_mostly annotation removed).

Ok!

>> +static int ip_vs_genl_fill_stats(struct sk_buff *skb, int container_type,
>> +                                struct ip_vs_stats *stats)
>> +{
>> +       struct nlattr *nl_stats = nla_nest_start(skb, container_type);
>> +       if (!nl_stats)
>> +               goto nla_put_failure;
>
> Unbalanced locking.

Whoa, right! Will correct that.

>> +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?

>> +void ip_vs_genl_unregister(void)
>> +{
>> +       genl_unregister_family(&ip_vs_genl_family);
>
> Doesn't it also has to unregister the ops?

No, that happens automatically when you unregister the family.

Julius

-- 
Google Switzerland GmbH
--
To unsubscribe from this list: send the line "unsubscribe lvs-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

<Prev in Thread] Current Thread [Next in Thread>