commit 13b57d93ac080996a2857ef0be4b367834447786
parent de5d80e928daf2f67a8151796a5f9ca4ac4663e2
Author: sin <sin@2f30.org>
Date: Tue, 5 Mar 2019 11:25:16 +0000
Rebuild cache if there is a mismatch between # of entries and # of blocks
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dedup.c b/dedup.c
@@ -550,7 +550,9 @@ load_cache(void)
xlseek(cfd, 0, SEEK_SET);
nr_entries = cache_nr_entries();
- if (nr_entries == 0) {
+ if (nr_entries != snap_hdr.st.nr_blks) {
+ if (verbose > 0)
+ fprintf(stderr, "Rebuilding cache\n");
xlseek(ifd, SNAP_HDR_SIZE, SEEK_SET);
walk_snap(reload_cache, NULL);
return;