Skip block descriptors with a reference count of 0 - dedup - deduplicating backup program HTML git clone git://bitreich.org/dedup/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/dedup/ DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- DIR commit 918648012d5b18fa898b7338de99e16583a0f7f6 DIR parent bbf67fa1bcab3beca309146d829ac3cc3ce1aceb HTML Author: sin <sin@2f30.org> Date: Thu, 25 Apr 2019 21:43:42 +0100 Skip block descriptors with a reference count of 0 Diffstat: M bstorage.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- DIR diff --git a/bstorage.c b/bstorage.c @@ -279,7 +279,10 @@ loadbd(struct sctx *sctx) return -1; } - RB_INSERT(bdcache, &sctx->bdcache, bd); + if (bd->refcnt > 0) + RB_INSERT(bdcache, &sctx->bdcache, bd); + else + free(bd); return 0; }