[SCM] CTDB repository - branch 1.2 updated - ctdb-1.0.114-320-gd9ace01

Ronnie Sahlberg sahlberg at samba.org
Thu Sep 2 20:01:13 MDT 2010


The branch, 1.2 has been updated
       via  d9ace0124b23ab4fd3db87c908f0562dac845545 (commit)
       via  799f4ee0d81175337c993006006b5e6c26e11cf1 (commit)
      from  4a9ccccb8a57e7cc256b167b2d51d3797e23951e (commit)

http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=1.2


- Log -----------------------------------------------------------------
commit d9ace0124b23ab4fd3db87c908f0562dac845545
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Fri Sep 3 11:58:27 2010 +1000

    When memory allocations for recovery fails,
    dont dereference a null pointer while trying to print the log message for the failure.
    
    also shutdown ctdb with ctdb_fatal()

commit 799f4ee0d81175337c993006006b5e6c26e11cf1
Author: Harald Klatte <klatte at hrz.uni-kassel.de>
Date:   Mon Aug 30 10:40:43 2010 +0200

    AIX bind wants the correct addrsize

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

Summary of changes:
 common/system_common.c |    5 ++++-
 server/ctdb_recover.c  |    6 ++----
 2 files changed, 6 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/common/system_common.c b/common/system_common.c
index 9aa4620..f28045f 100644
--- a/common/system_common.c
+++ b/common/system_common.c
@@ -50,13 +50,16 @@ bool ctdb_sys_have_ip(ctdb_sock_addr *_addr)
 	int ret;
 	ctdb_sock_addr __addr = *_addr;
 	ctdb_sock_addr *addr = &__addr;
+	socklen_t addrlen;
 
 	switch (addr->sa.sa_family) {
 	case AF_INET:
 		addr->ip.sin_port = 0;
+		addrlen = sizeof(struct sockaddr_in);
 		break;
 	case AF_INET6:
 		addr->ip6.sin6_port = 0;
+		addrlen = sizeof(struct sockaddr_in6);
 		break;
 	}
 
@@ -65,7 +68,7 @@ bool ctdb_sys_have_ip(ctdb_sock_addr *_addr)
 		return false;
 	}
 
-	ret = bind(s, (struct sockaddr *)addr, sizeof(ctdb_sock_addr));
+	ret = bind(s, (struct sockaddr *)addr, addrlen);
 
 	close(s);
 	return ret == 0;
diff --git a/server/ctdb_recover.c b/server/ctdb_recover.c
index e1c7b16..81e2d4b 100644
--- a/server/ctdb_recover.c
+++ b/server/ctdb_recover.c
@@ -340,10 +340,8 @@ static int traverse_pulldb(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data,
 	}
 	params->pulldata = talloc_realloc_size(NULL, params->pulldata, rec->length + params->len);
 	if (params->pulldata == NULL) {
-		DEBUG(DEBUG_ERR,(__location__ " Failed to expand pulldb_data to %u (%u records)\n", 
-			 rec->length + params->len, params->pulldata->count));
-		params->failed = true;
-		return -1;
+		DEBUG(DEBUG_CRIT,(__location__ " Failed to expand pulldb_data to %u\n", rec->length + params->len));
+		ctdb_fatal(params->ctdb, "failed to allocate memory for recovery. shutting down\n");
 	}
 	params->pulldata->count++;
 	memcpy(params->len+(uint8_t *)params->pulldata, rec, rec->length);


-- 
CTDB repository


More information about the samba-cvs mailing list