]> Pileus Git - ~andy/linux/blobdiff - net/netfilter/ipvs/ip_vs_rr.c
Merge tag 'multiplatform-for-linus-2' of git://git.kernel.org/pub/scm/linux/kernel...
[~andy/linux] / net / netfilter / ipvs / ip_vs_rr.c
index aa4601ff1cccacab47cb2d5f1d8e43d37e00440e..c35986c793d903d3565be462321c6e953acf556e 100644 (file)
@@ -63,7 +63,7 @@ ip_vs_rr_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
 
        IP_VS_DBG(6, "%s(): Scheduling...\n", __func__);
 
-       spin_lock(&svc->sched_lock);
+       spin_lock_bh(&svc->sched_lock);
        p = (struct list_head *) svc->sched_data;
        last = dest = list_entry(p, struct ip_vs_dest, n_list);
 
@@ -85,13 +85,13 @@ ip_vs_rr_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
        } while (pass < 2 && p != &svc->destinations);
 
 stop:
-       spin_unlock(&svc->sched_lock);
+       spin_unlock_bh(&svc->sched_lock);
        ip_vs_scheduler_err(svc, "no destination available");
        return NULL;
 
   out:
        svc->sched_data = &dest->n_list;
-       spin_unlock(&svc->sched_lock);
+       spin_unlock_bh(&svc->sched_lock);
        IP_VS_DBG_BUF(6, "RR: server %s:%u "
                      "activeconns %d refcnt %d weight %d\n",
                      IP_VS_DBG_ADDR(svc->af, &dest->addr), ntohs(dest->port),
@@ -121,6 +121,7 @@ static int __init ip_vs_rr_init(void)
 static void __exit ip_vs_rr_cleanup(void)
 {
        unregister_ip_vs_scheduler(&ip_vs_rr_scheduler);
+       synchronize_rcu();
 }
 
 module_init(ip_vs_rr_init);