Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
[firefly-linux-kernel-4.4.55.git] / net / ipv4 / netfilter / ipt_CLUSTERIP.c
index c6cf84c776116a6db394da69947547d20e324b17..380d8daac72b8f304954bba42b3236a4079e7c64 100644 (file)
@@ -82,8 +82,8 @@ clusterip_config_put(struct clusterip_config *c)
 static inline void
 clusterip_config_entry_put(struct clusterip_config *c)
 {
+       write_lock_bh(&clusterip_lock);
        if (atomic_dec_and_test(&c->entries)) {
-               write_lock_bh(&clusterip_lock);
                list_del(&c->list);
                write_unlock_bh(&clusterip_lock);
 
@@ -96,7 +96,9 @@ clusterip_config_entry_put(struct clusterip_config *c)
 #ifdef CONFIG_PROC_FS
                remove_proc_entry(c->pde->name, c->pde->parent);
 #endif
+               return;
        }
+       write_unlock_bh(&clusterip_lock);
 }
 
 static struct clusterip_config *
@@ -167,14 +169,13 @@ clusterip_config_init(struct ipt_clusterip_tgt_info *i, __be32 ip,
 
                /* create proc dir entry */
                sprintf(buffer, "%u.%u.%u.%u", NIPQUAD(ip));
-               c->pde = create_proc_entry(buffer, S_IWUSR|S_IRUSR,
-                                          clusterip_procdir);
+               c->pde = proc_create(buffer, S_IWUSR|S_IRUSR,
+                                    clusterip_procdir, &clusterip_proc_fops);
                if (!c->pde) {
                        kfree(c);
                        return NULL;
                }
        }
-       c->pde->proc_fops = &clusterip_proc_fops;
        c->pde->data = c;
 #endif
 
@@ -332,7 +333,7 @@ clusterip_tg(struct sk_buff *skb, const struct net_device *in,
        }
 
 #ifdef DEBUG
-       DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
+       NF_CT_DUMP_TUPLE(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple);
 #endif
        pr_debug("hash=%u ct_hash=%u ", hash, ct->mark);
        if (!clusterip_responsible(cipinfo->config, hash)) {