From: Michael Adam Date: Mon, 10 Feb 2014 01:44:56 +0000 (+0100) Subject: ctdb:vacuum: move retrieval of freelist to after vacuum run X-Git-Tag: tdb-1.2.13~366 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0535f73c3abdcd77cb3f5e9f81641fa2a4e1764b;p=thirdparty%2Fsamba.git ctdb:vacuum: move retrieval of freelist to after vacuum run The fast vacuum run may have increased the freelist size. Signed-off-by: Michael Adam Reviewed-by: Amitay Isaacs Autobuild-User(master): Amitay Isaacs Autobuild-Date(master): Fri Feb 14 03:15:30 CET 2014 on sn-devel-104 --- diff --git a/ctdb/server/ctdb_vacuum.c b/ctdb/server/ctdb_vacuum.c index f6900aaf548..22603b833d8 100644 --- a/ctdb/server/ctdb_vacuum.c +++ b/ctdb/server/ctdb_vacuum.c @@ -1431,12 +1431,6 @@ static int ctdb_vacuum_and_repack_db(struct ctdb_db_context *ctdb_db, int freelist_size; struct vacuum_data *vdata; - freelist_size = tdb_freelist_size(ctdb_db->ltdb->tdb); - if (freelist_size == -1) { - DEBUG(DEBUG_ERR,(__location__ " Failed to get freelist size for '%s'\n", name)); - return -1; - } - vdata = talloc_zero(mem_ctx, struct vacuum_data); if (vdata == NULL) { DEBUG(DEBUG_ERR,(__location__ " Out of memory\n")); @@ -1463,6 +1457,13 @@ static int ctdb_vacuum_and_repack_db(struct ctdb_db_context *ctdb_db, DEBUG(DEBUG_ERR,(__location__ " Failed to vacuum '%s'\n", name)); } + freelist_size = tdb_freelist_size(ctdb_db->ltdb->tdb); + if (freelist_size == -1) { + DEBUG(DEBUG_ERR,(__location__ " Failed to get freelist size for '%s'\n", name)); + talloc_free(vdata); + return -1; + } + /* * decide if a repack is necessary */