s3:dbwrap_ctdb: fix db_ctdb_fetch_db_seqnum_from_db() when NT_STATUS_NOT_FOUND.
authorMichael Adam <obnox@samba.org>
Fri, 11 Dec 2009 23:30:37 +0000 (00:30 +0100)
committerMichael Adam <obnox@samba.org>
Fri, 12 Feb 2010 22:12:11 +0000 (23:12 +0100)
Don't treat this as an error but return seqnum 0 instead.

Michael

source3/lib/dbwrap_ctdb.c

index fb99e1d9cf52c5265d6856dd5bd682c02f279a4c..4c4486c53971f775dc5a0d46f93e8765f1252b41 100644 (file)
@@ -685,10 +685,14 @@ static NTSTATUS db_ctdb_fetch_db_seqnum_from_db(struct db_ctdb_ctx *db,
        key.dsize = strlen(keyname) + 1;
 
        status = db_ctdb_ltdb_fetch(db, key, &header, mem_ctx, &data);
        key.dsize = strlen(keyname) + 1;
 
        status = db_ctdb_ltdb_fetch(db, key, &header, mem_ctx, &data);
-       if (!NT_STATUS_IS_OK(status)) {
+       if (!NT_STATUS_IS_OK(status) &&
+           !NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND))
+       {
                goto done;
        }
 
                goto done;
        }
 
+       status = NT_STATUS_OK;
+
        if (data.dsize != sizeof(uint64_t)) {
                *seqnum = 0;
                goto done;
        if (data.dsize != sizeof(uint64_t)) {
                *seqnum = 0;
                goto done;