Commit 19ff8f18 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Fix the VBE/VCL reference count anomaly

parent c7e37380
...@@ -479,7 +479,7 @@ vdi_simple_fini(const struct director *d) ...@@ -479,7 +479,7 @@ vdi_simple_fini(const struct director *d)
CAST_OBJ_NOTNULL(vs, d->priv, VDI_SIMPLE_MAGIC); CAST_OBJ_NOTNULL(vs, d->priv, VDI_SIMPLE_MAGIC);
VBP_Stop(vs->backend, vs->vrt->probe); VBP_Stop(vs->backend, vs->vrt->probe);
VBE_DropRef(vs->backend); VBE_DropRefVcl(vs->backend);
free(vs->dir.vcl_name); free(vs->dir.vcl_name);
vs->dir.magic = 0; vs->dir.magic = 0;
FREE_OBJ(vs); FREE_OBJ(vs);
......
...@@ -143,7 +143,7 @@ struct backend *vdi_get_backend_if_simple(const struct director *d); ...@@ -143,7 +143,7 @@ struct backend *vdi_get_backend_if_simple(const struct director *d);
/* cache_backend_cfg.c */ /* cache_backend_cfg.c */
extern struct lock VBE_mtx; extern struct lock VBE_mtx;
void VBE_DropRefConn(struct backend *); void VBE_DropRefConn(struct backend *);
void VBE_DropRef(struct backend *); void VBE_DropRefVcl(struct backend *);
void VBE_DropRefLocked(struct backend *b); void VBE_DropRefLocked(struct backend *b);
/* cache_backend_poll.c */ /* cache_backend_poll.c */
......
...@@ -106,7 +106,6 @@ VBE_DropRefLocked(struct backend *b) ...@@ -106,7 +106,6 @@ VBE_DropRefLocked(struct backend *b)
assert(b->refcount > 0); assert(b->refcount > 0);
i = --b->refcount; i = --b->refcount;
b->vsc->vcls--;
Lck_Unlock(&b->mtx); Lck_Unlock(&b->mtx);
if (i > 0) if (i > 0)
return; return;
...@@ -125,12 +124,13 @@ VBE_DropRefLocked(struct backend *b) ...@@ -125,12 +124,13 @@ VBE_DropRefLocked(struct backend *b)
} }
void void
VBE_DropRef(struct backend *b) VBE_DropRefVcl(struct backend *b)
{ {
CHECK_OBJ_NOTNULL(b, BACKEND_MAGIC); CHECK_OBJ_NOTNULL(b, BACKEND_MAGIC);
Lck_Lock(&b->mtx); Lck_Lock(&b->mtx);
b->vsc->vcls--;
VBE_DropRefLocked(b); VBE_DropRefLocked(b);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment