commit 918648012d5b18fa898b7338de99e16583a0f7f6 parent bbf67fa1bcab3beca309146d829ac3cc3ce1aceb 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(-)
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; }