]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
dbwrap_ctdb: return correct record count for a persistent db read-only traverse
authorRalph Boehme <slow@samba.org>
Mon, 10 Sep 2018 10:50:01 +0000 (12:50 +0200)
committerJeremy Allison <jra@samba.org>
Wed, 12 Sep 2018 23:34:30 +0000 (01:34 +0200)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep 13 01:34:30 CEST 2018 on sn-devel-144

source3/lib/dbwrap/dbwrap_ctdb.c

index c6100e3fbaf52330c4e977ad12cb24866e5d4e51..b487d10bddbbf17bbcc1376cbab1dead62443380 100644 (file)
@@ -1768,7 +1768,15 @@ static int db_ctdb_traverse_read(struct db_context *db,
        if (db->persistent) {
                /* for persistent databases we don't need to do a ctdb traverse,
                   we can do a faster local traverse */
-               return tdb_traverse_read(ctx->wtdb->tdb, traverse_persistent_callback_read, &state);
+               int nrecs;
+
+               nrecs = tdb_traverse_read(ctx->wtdb->tdb,
+                                         traverse_persistent_callback_read,
+                                         &state);
+               if (nrecs == -1) {
+                       return -1;
+               }
+               return state.count;
        }
 
        ret = db_ctdbd_traverse(ctx->db_id, traverse_read_callback, &state);