[SCM] SAMBA-CTDB repository - branch v3-4-ctdb updated - 3.4.2-ctdb-16-2-g68747f4

Michael Adam obnox at samba.org
Wed Jan 6 10:43:00 MST 2010


The branch, v3-4-ctdb has been updated
       via  68747f49c7338a905ed9beac6300b20c0a8a064e (commit)
      from  b130fa9d595893621c8f5b9088f4e123bc9644c5 (commit)

http://gitweb.samba.org/?p=obnox/samba-ctdb.git;a=shortlog;h=v3-4-ctdb


- Log -----------------------------------------------------------------
commit 68747f49c7338a905ed9beac6300b20c0a8a064e
Author: Michael Adam <obnox at samba.org>
Date:   Wed Jan 6 00:37:21 2010 +0100

    s3:dbwrap_ctdb: fix logic error in pull_newest_from_marshall_buffer().
    
    The logic bug was that if a record was found in the marshall buffer,
    then always the ctdb header of tha last record in the marshall buffer
    was returned, and not the ctdb header of the last occurrence of the
    requested record.
    
    This is fixed by introducing an additional temporary variable.
    
    Michael

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

Summary of changes:
 source3/lib/dbwrap_ctdb.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/dbwrap_ctdb.c b/source3/lib/dbwrap_ctdb.c
index d6fde35..4e97d26 100644
--- a/source3/lib/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap_ctdb.c
@@ -403,8 +403,11 @@ static bool pull_newest_from_marshall_buffer(struct ctdb_marshall_buffer *buf,
 	for (i=0; i<buf->count; i++) {
 		TDB_DATA tkey, tdata;
 		uint32_t reqid;
+		struct ctdb_ltdb_header hdr;
 
-		rec = db_ctdb_marshall_loop_next(buf, rec, &reqid, &h, &tkey,
+		ZERO_STRUCT(hdr);
+
+		rec = db_ctdb_marshall_loop_next(buf, rec, &reqid, &hdr, &tkey,
 						 &tdata);
 		if (rec == NULL) {
 			return false;
@@ -413,6 +416,7 @@ static bool pull_newest_from_marshall_buffer(struct ctdb_marshall_buffer *buf,
 		if (tdb_data_equal(key, tkey)) {
 			found = true;
 			data = tdata;
+			h = hdr;
 		}
 	}
 


-- 
SAMBA-CTDB repository


More information about the samba-cvs mailing list