netdev
[Top] [All Lists]

[PATCH] ipvs -- fix error's in list_for_each changes.

To: Julian Anastasov <ja@xxxxxx>, "David S. Miller" <davem@xxxxxxxxxx>
Subject: [PATCH] ipvs -- fix error's in list_for_each changes.
From: Stephen Hemminger <shemminger@xxxxxxxx>
Date: Mon, 22 Sep 2003 11:22:04 -0700
Cc: Wensong Zhang <wensong@xxxxxxxxxxxx>, <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>, <netdev@xxxxxxxxxxx>
In-reply-to: <Pine.LNX.4.44.0309210934460.1468-100000@u.domain.uli>
Organization: Open Source Development Lab
References: <20030916141750.53bbb04e.shemminger@osdl.org> <Pine.LNX.4.44.0309210934460.1468-100000@u.domain.uli>
Sender: netdev-bounce@xxxxxxxxxxx
The earlier list_for_each changes introduced a couple of bugs where
lines got dropped.  This restores them.

diff -Nru a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c
--- a/net/ipv4/ipvs/ip_vs_app.c Mon Sep 22 11:19:05 2003
+++ b/net/ipv4/ipvs/ip_vs_app.c Mon Sep 22 11:19:05 2003
@@ -222,6 +222,8 @@
                ip_vs_app_inc_release(inc);
        }
 
+       list_del(&app->a_list);
+
        up(&__ip_vs_app_mutex);
 
        /* decrease the module use count */
diff -Nru a/net/ipv4/ipvs/ip_vs_rr.c b/net/ipv4/ipvs/ip_vs_rr.c
--- a/net/ipv4/ipvs/ip_vs_rr.c  Mon Sep 22 11:19:05 2003
+++ b/net/ipv4/ipvs/ip_vs_rr.c  Mon Sep 22 11:19:05 2003
@@ -73,12 +73,12 @@
                        continue;
                }
                
-       
                dest = list_entry(q, struct ip_vs_dest, n_list);
                if (!(dest->flags & IP_VS_DEST_F_OVERLOAD) &&
                    atomic_read(&dest->weight) > 0)
                        /* HIT */
                        goto out;
+               q = q->next;
        } while (q != p);
        write_unlock(&svc->sched_lock);
        return NULL;

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