Send Linux-ha-cvs mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs
or, via email, send a message with subject or body 'help' to
        [EMAIL PROTECTED]

You can reach the person managing the list at
        [EMAIL PROTECTED]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Linux-ha-cvs digest..."


Today's Topics:

   1. Linux-HA CVS: membership by panjiam from 
      ([email protected])
   2. Linux-HA CVS: snmp_subagent by panjiam from 
      ([email protected])
   3. Linux-HA CVS: lib by sunjd from  ([email protected])


----------------------------------------------------------------------

Message: 1
Date: Tue, 29 Nov 2005 19:03:00 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: membership by panjiam from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : panjiam
Host    : 
Project : linux-ha
Module  : membership

Dir     : linux-ha/membership/ccm


Modified Files:
        ccmlib_clm.c ccmlib_eventapi.c 


Log Message:
fixed memory leak and fd leak, bug # 858
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/membership/ccm/ccmlib_clm.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- ccmlib_clm.c        29 Jul 2005 23:02:03 -0000      1.11
+++ ccmlib_clm.c        30 Nov 2005 02:02:59 -0000      1.12
@@ -144,12 +144,14 @@
        SaClmHandleT *hash_key;
        fd_set rset;
        struct timeval tv;
+        SaErrorT rc;
 
        oc_ev_register(&ev_token);
        if ((ret = oc_ev_set_callback(ev_token, OC_EV_MEMB_CLASS
        ,       ccm_events, NULL)) != 0) {
                if (ret == ENOMEM){
-                       return SA_ERR_NO_MEMORY;
+                       rc = SA_ERR_NO_MEMORY;
+                        goto err_nomem_exit;
                }
                else{
                        assert(0);      /* Never runs here */
@@ -163,12 +165,15 @@
 
        hash_key = (SaClmHandleT *)g_malloc(sizeof(SaClmHandleT));
        if (!hash_key){
-               return SA_ERR_NO_MEMORY;
+               rc = SA_ERR_NO_MEMORY;
+                goto err_nomem_exit;
        }
 
        hd = (__clm_handle_t *)g_malloc(sizeof(__clm_handle_t));
        if (!hd){
-               return SA_ERR_NO_MEMORY;
+                g_free(hash_key);
+               rc = SA_ERR_NO_MEMORY;
+                goto err_nomem_exit;
        }
 
        *clmHandle = __handle_counter++;
@@ -181,7 +186,8 @@
 
        if ((ret = oc_ev_activate(hd->ev_token, &hd->fd)) != 0) {
                cl_log(LOG_ERR, "oc_ev_activate error [%d]", ret);
-               return SA_ERR_LIBRARY;
+               rc = SA_ERR_LIBRARY;
+                goto err_lib_exit;
        }
 
        /* Prepare information for saClmClusterNodeGet() series calls */
@@ -195,21 +201,33 @@
                if ((ret = select(hd->fd + 1, &rset, NULL, NULL, &tv)) == -1) {
                        cl_log(LOG_ERR, "%s: select error [%d]"
                        ,       __FUNCTION__, ret);
-                       return SA_ERR_LIBRARY;
+                       rc = SA_ERR_LIBRARY;
+                        goto err_lib_exit;
 
                } else if (ret == 0) {
                        cl_log(LOG_WARNING, "%s: select timeout", __FUNCTION__);
-                       return SA_ERR_TIMEOUT;
+                       rc = SA_ERR_TIMEOUT;
+                        goto err_lib_exit;
                }
 
                if ((ret = oc_ev_handle_event(hd->ev_token) != 0)) {
                        cl_log(LOG_ERR, "%s: oc_ev_handle_event error [%d]"
                        ,       __FUNCTION__, ret);
-                       return SA_ERR_LIBRARY;
+                       rc = SA_ERR_LIBRARY;
+                        goto err_lib_exit;
                }
 
        }
        return SA_OK;
+
+ err_nomem_exit:
+        g_hash_table_remove(__handle_hash, hash_key);
+        g_free(hd);
+        g_free(hash_key);
+
+ err_lib_exit:
+        oc_ev_unregister(ev_token);
+        return rc;
 }
 
 SaErrorT 
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/membership/ccm/ccmlib_eventapi.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- ccmlib_eventapi.c   29 Jul 2005 23:02:03 -0000      1.10
+++ ccmlib_eventapi.c   30 Nov 2005 02:02:59 -0000      1.11
@@ -1,4 +1,4 @@
-/* $Id: ccmlib_eventapi.c,v 1.10 2005/07/29 23:02:03 alan Exp $ */
+/* $Id: ccmlib_eventapi.c,v 1.11 2005/11/30 02:02:59 panjiam Exp $ */
 /* 
  * ccmlib_eventapi.c: OCF event API.
  *
@@ -212,9 +212,13 @@
        class_t  *class = (class_t *)value;
 
        /* if handle event fails, remove this class */
-       if(!class->handle_event((void *)class))
-               return TRUE;
-
+       if(!class->handle_event((void *)class)){
+               /* before we remove this class, 
+                   we should unregister and free it first */
+                class->unregister(class);
+                g_free(class);
+                return TRUE;
+        }
        /*do not remove this class*/
        return FALSE;
 }




------------------------------

Message: 2
Date: Tue, 29 Nov 2005 19:03:40 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: snmp_subagent by panjiam from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : panjiam
Host    : 
Project : linux-ha
Module  : snmp_subagent

Dir     : linux-ha/snmp_subagent


Modified Files:
        hbagent.c 


Log Message:
fixed memory leak and fd leak, bug # 858
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/snmp_subagent/hbagent.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- hbagent.c   10 Sep 2005 17:54:23 -0000      1.40
+++ hbagent.c   30 Nov 2005 02:03:40 -0000      1.41
@@ -817,7 +817,9 @@
                           again later. */
                        clmInitialized = 0;
                        free_membershiptable();
-
+                        
+                        /* finalize membership */
+                        saClmFinlize(&clm);
                        return HA_OK;
                } else {
                    cl_log(LOG_WARNING, "saClmDispatch error, ret = [%d]", ret);




------------------------------

Message: 3
Date: Tue, 29 Nov 2005 19:28:38 -0700 (MST)
From: [email protected]
Subject: [Linux-ha-cvs] Linux-HA CVS: lib by sunjd from 
To: [EMAIL PROTECTED]
Message-ID: <[EMAIL PROTECTED]>

linux-ha CVS committal

Author  : sunjd
Host    : 
Project : linux-ha
Module  : lib

Dir     : linux-ha/lib/plugins/stonith/external


Modified Files:
        ssh.in 


Log Message:
bug952: avoid to freeze for a long time
===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/lib/plugins/stonith/external/ssh.in,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- ssh.in      17 Nov 2005 05:32:31 -0000      1.7
+++ ssh.in      30 Nov 2005 02:28:37 -0000      1.8
@@ -41,7 +41,7 @@
        for j in 1 2 3
         do
           if
-            ping -w0.5 -c1 "$1" >/dev/null 2>&1
+            ping -w1 -c1 "$1" >/dev/null 2>&1
           then
             return 1
           fi
@@ -97,7 +97,7 @@
        for h in $hostlist
        do
          if
-           host $h 2>&1 | grep "not found:"
+            ping -w1 -c1 "$h" 2>&1 | grep "unknown host"
           then
            exit 1
          fi




------------------------------

_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs


End of Linux-ha-cvs Digest, Vol 24, Issue 69
********************************************

Reply via email to