LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

???[PATCH] IPVS syncd zombies fixe???

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: ???[PATCH] IPVS syncd zombies fixe???
From: Brad Chang <keepalived@xxxxxxxxxx>
Date: Tue, 31 Aug 2004 06:52:46 -0700
Hi List,

Has anyone sucsessfully applied and used Alex. ip_vs_sync.c patch?  I tryed to 
patch and even when manually patching the ip_vs_sync.c I get errors when 
compiling.

diff -urN kernel-source-2.6.8.orig/net/ipv4/ipvs/ip_vs_sync.c kernel-source-
2.6.8/net/ipv4/ipvs/ip_vs_sync.c
--- linux-2.6.7.orig/net/ipv4/ipvs/ip_vs_sync.c 2004-06-16 07:18:38.000000000 
+0200
+++ linux-2.6.7/net/ipv4/ipvs/ip_vs_sync.c      2004-08-17 18:30:36.143940704 
+0200
@@ -18,9 +18,11 @@
   *                                     messages filtering.
   */

+#define __KERNEL_SYSCALLS__            /*  for waitpid */
+
  #include <linux/module.h>
  #include <linux/slab.h>
-#include <linux/net.h>
+#include <linux/unistd.h>
  #include <linux/completion.h>

  #include <linux/skbuff.h>
@@ -612,6 +614,7 @@
         return len;
  }

+static int errno;

  static DECLARE_WAIT_QUEUE_HEAD(sync_wait);
  static pid_t sync_master_pid = 0;
@@ -840,6 +843,7 @@
  int start_sync_thread(int state, char *mcast_ifn, __u8 syncid)
  {
         DECLARE_COMPLETION(startup);
+       int waitpid_result;
         pid_t pid;

         if ((state == IP_VS_STATE_MASTER && sync_master_pid) ||
@@ -868,6 +872,15 @@
                 goto repeat;
         }

+       /*
+        * We must reap the fork_sync_thread here. Really needed to not
+        * produce zombies while returning.
+        */
+       if ((waitpid_result = waitpid(pid, NULL, __WCLONE)) != pid) {
+               IP_VS_ERR("%s: waitpid(%d,...) failed, errno %d\n",
+                         __FUNCTION__, pid, -waitpid_result);
+       }
+
         wait_for_completion(&startup);

         return 0;




Thanks
-Brad Chang
-http://www.dotnoc.com


----------------------------------------------------------------
http://www.dotnoc.com hosting the way it should be.

<Prev in Thread] Current Thread [Next in Thread>
  • ???[PATCH] IPVS syncd zombies fixe???, Brad Chang <=