From 36aa395e4903d7400eccd37ec6a7c0a216c5e407 Mon Sep 17 00:00:00 2001 From: Dan Christensen Date: Sat, 11 Feb 2023 20:11:09 -0500 Subject: [PATCH] _hashindex.c: set min_empty and num_empty even when permit_compact=True --- src/borg/_hashindex.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/borg/_hashindex.c b/src/borg/_hashindex.c index 65ed9eb43..2184e3997 100644 --- a/src/borg/_hashindex.c +++ b/src/borg/_hashindex.c @@ -570,11 +570,11 @@ hashindex_read(PyObject *file_py, int permit_compact, int legacy) } index->buckets = index->buckets_buffer.buf; - if(!permit_compact) { - index->min_empty = get_min_empty(index->num_buckets); - if (index->num_empty == -1) // we read a legacy index without num_empty value - index->num_empty = count_empty(index); + index->min_empty = get_min_empty(index->num_buckets); + if (index->num_empty == -1) // we read a legacy index without num_empty value + index->num_empty = count_empty(index); + if(!permit_compact) { if(index->num_empty < index->min_empty) { /* too many tombstones here / not enough empty buckets, do a same-size rebuild */ if(!hashindex_resize(index, index->num_buckets)) {