diff options
author | Michael Adam <obnox@samba.org> | 2014-02-10 02:44:56 +0100 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2014-02-14 03:15:30 +0100 |
commit | 0535f73c3abdcd77cb3f5e9f81641fa2a4e1764b (patch) | |
tree | 4a12f5cb8524a9c1502f2cceee6212e31e373769 | |
parent | bd474985b1db572cb08eff39b25ecae2b9d0dea8 (diff) | |
download | samba-0535f73c3abdcd77cb3f5e9f81641fa2a4e1764b.tar.gz samba-0535f73c3abdcd77cb3f5e9f81641fa2a4e1764b.tar.xz samba-0535f73c3abdcd77cb3f5e9f81641fa2a4e1764b.zip |
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 <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Feb 14 03:15:30 CET 2014 on sn-devel-104
-rw-r--r-- | ctdb/server/ctdb_vacuum.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ctdb/server/ctdb_vacuum.c b/ctdb/server/ctdb_vacuum.c index f6900aaf54..22603b833d 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 */ |