LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

[PATCH-2.4] misc cleanup

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: [PATCH-2.4] misc cleanup
From: Roberto Nibali <ratz@xxxxxxxxxxxx>
Date: Thu, 19 Jun 2003 01:19:56 +0200
Hello Wensong,

While backporting the threshold stuff last night I stumbled over some subtleties which I've collected in a comprising patch. Please consider applying, it's against ipvs-1.0.9.

Thanks and best regards,
Roberto Nibali, ratz
--
echo '[q]sa[ln0=aln256%Pln256/snlbx]sb3135071790101768542287578439snlbxq'|dc
diff -ur ipvs-1.0.9/ipvs/ip_vs_conn.c ipvs-1.0.9-misc/ipvs/ip_vs_conn.c
--- ipvs-1.0.9/ipvs/ip_vs_conn.c        2003-04-11 16:02:35.000000000 +0200
+++ ipvs-1.0.9-misc/ipvs/ip_vs_conn.c   2003-06-18 11:40:13.000000000 +0200
@@ -1089,38 +1089,39 @@
 {
        struct ip_vs_dest *dest = cp->dest;
 
-       if (dest) {
-               IP_VS_DBG(9, "Unbind-dest %s c:%u.%u.%u.%u:%d "
-                         "v:%u.%u.%u.%u:%d d:%u.%u.%u.%u:%d fwd:%c "
-                         "s:%s flg:%X cnt:%d destcnt:%d",
-                         ip_vs_proto_name(cp->protocol),
-                         NIPQUAD(cp->caddr), ntohs(cp->cport),
-                         NIPQUAD(cp->vaddr), ntohs(cp->vport),
-                         NIPQUAD(cp->daddr), ntohs(cp->dport),
-                         ip_vs_fwd_tag(cp), ip_vs_state_name(cp->state),
-                         cp->flags, atomic_read(&cp->refcnt),
-                         atomic_read(&dest->refcnt));
+       /* if dest is NULL, then return directly */
+       if (!dest)
+               return;
+       IP_VS_DBG(9, "Unbind-dest %s c:%u.%u.%u.%u:%d "
+                 "v:%u.%u.%u.%u:%d d:%u.%u.%u.%u:%d fwd:%c "
+                 "s:%s flg:%X cnt:%d destcnt:%d",
+                 ip_vs_proto_name(cp->protocol),
+                 NIPQUAD(cp->caddr), ntohs(cp->cport),
+                 NIPQUAD(cp->vaddr), ntohs(cp->vport),
+                 NIPQUAD(cp->daddr), ntohs(cp->dport),
+                 ip_vs_fwd_tag(cp), ip_vs_state_name(cp->state),
+                 cp->flags, atomic_read(&cp->refcnt),
+                 atomic_read(&dest->refcnt));
 
-               /*
-                * Decrease the inactconns or activeconns counter
-                * if it is not a connection template ((cp->cport!=0)
-                *   || (cp->flags & IP_VS_CONN_F_NO_CPORT)).
-                */
-               if (cp->cport || (cp->flags & IP_VS_CONN_F_NO_CPORT)) {
-                       if (cp->flags & IP_VS_CONN_F_INACTIVE) {
-                               atomic_dec(&dest->inactconns);
-                       } else {
-                               atomic_dec(&dest->activeconns);
-                       }
+       /*
+        * Decrease the inactconns or activeconns counter
+        * if it is not a connection template ((cp->cport!=0)
+        *   || (cp->flags & IP_VS_CONN_F_NO_CPORT)).
+        */
+       if (cp->cport || (cp->flags & IP_VS_CONN_F_NO_CPORT)) {
+               if (cp->flags & IP_VS_CONN_F_INACTIVE) {
+                       atomic_dec(&dest->inactconns);
+               } else {
+                       atomic_dec(&dest->activeconns);
                }
-
-               /*
-                * Simply decrease the refcnt of the dest, because the
-                * dest will be either in service's destination list
-                * or in the trash.
-                */
-               atomic_dec(&dest->refcnt);
        }
+
+       /*
+        * Simply decrease the refcnt of the dest, because the
+        * dest will be either in service's destination list
+        * or in the trash.
+        */
+       atomic_dec(&dest->refcnt);
 }
 
 
diff -ur ipvs-1.0.9/ipvs/ipvsadm/config_stream.c 
ipvs-1.0.9-misc/ipvs/ipvsadm/config_stream.c
--- ipvs-1.0.9/ipvs/ipvsadm/config_stream.c     2001-03-22 13:57:46.000000000 
+0100
+++ ipvs-1.0.9-misc/ipvs/ipvsadm/config_stream.c        2003-06-18 
11:53:12.000000000 +0200
@@ -23,7 +23,7 @@
  *         tokens read from the stream. Result is returned
  *         once a newline is reached so multiple calls
  *         will be required to read an entire stream.
- *         Everthing including and after a hash (#) on a line is 
+ *         Everything including and after a hash (#) on a line is 
  *         ignored
  **********************************************************************/
 
diff -ur ipvs-1.0.9/ipvs/ipvsadm/dynamic_array.c 
ipvs-1.0.9-misc/ipvs/ipvsadm/dynamic_array.c
--- ipvs-1.0.9/ipvs/ipvsadm/dynamic_array.c     2001-03-22 13:57:46.000000000 
+0100
+++ ipvs-1.0.9-misc/ipvs/ipvsadm/dynamic_array.c        2003-06-18 
11:57:25.000000000 +0200
@@ -78,7 +78,7 @@
  *                         a copy of the element Any memory allocation 
  *                         required should be done by this function.
  * post: element in inserted in the first unused position in the array
- *       array size is incresaed by a->block_size if there is 
+ *       array size is increased by a->block_size if there is 
  *       insufficient room in the array to add the element.
  *       Nothing is done if e is NULL
  * return: a on success
diff -ur ipvs-1.0.9/ipvs/ipvsadm/dynamic_array.h 
ipvs-1.0.9-misc/ipvs/ipvsadm/dynamic_array.h
--- ipvs-1.0.9/ipvs/ipvsadm/dynamic_array.h     2001-03-22 13:57:46.000000000 
+0100
+++ ipvs-1.0.9-misc/ipvs/ipvsadm/dynamic_array.h        2003-06-18 
11:57:41.000000000 +0200
@@ -86,7 +86,7 @@
  *                         a copy of the element Any memory allocation 
  *                         required should be done by this function.
  * post: element in inserted in the first unused position in the array
- *       array size is incresaed by a->block_size if there is 
+ *       array size is increased by a->block_size if there is 
  *       insufficient room in the array to add the element.
  *       Nothing is done if e is NULL
  * return: a on success
diff -ur ipvs-1.0.9/ipvs/ipvsadm/ipvsadm.8 
ipvs-1.0.9-misc/ipvs/ipvsadm/ipvsadm.8
--- ipvs-1.0.9/ipvs/ipvsadm/ipvsadm.8   2003-05-21 05:01:57.000000000 +0200
+++ ipvs-1.0.9-misc/ipvs/ipvsadm/ipvsadm.8      2003-06-18 11:58:46.000000000 
+0200
@@ -30,7 +30,7 @@
 .\"     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 .\"
 .\"
-.TH IPVSADM 8 "21sr May 2003" "LVS Administration" "Linux Administrator's 
Guide"
+.TH IPVSADM 8 "21st May 2003" "LVS Administration" "Linux Administrator's 
Guide"
 .UC 4
 .SH NAME
 ipvsadm \- Linux Virtual Server administration
<Prev in Thread] Current Thread [Next in Thread>