Skip to content

Commit

Permalink
vbp: move VBH_NOIDX assertion to vbp_delete()
Browse files Browse the repository at this point in the history
  • Loading branch information
nigoroll committed Jul 8, 2024
1 parent 96d9bdb commit d03a0b5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions bin/varnishd/cache/cache_backend_probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ vbp_delete(struct vbp_target *vt)
{
CHECK_OBJ_NOTNULL(vt, VBP_TARGET_MAGIC);

assert(vt->heap_idx == VBH_NOIDX);

#define DN(x) /**/
VRT_BACKEND_PROBE_HANDLE();
#undef DN
Expand Down Expand Up @@ -462,7 +464,6 @@ vbp_task(struct worker *wrk, void *priv)
Lck_Lock(&vbp_mtx);
if (vt->running < 0) {
assert(vt->state == vbp_state_deleted);
assert(vt->heap_idx == VBH_NOIDX);
vbp_delete(vt);
} else {
assert(vt->state == vbp_state_running);
Expand Down Expand Up @@ -752,10 +753,8 @@ VBP_Remove(struct backend *be)
} else
assert(vt->state == vbp_state_cold);
Lck_Unlock(&vbp_mtx);
if (vt != NULL) {
assert(vt->heap_idx == VBH_NOIDX);
if (vt != NULL)
vbp_delete(vt);
}
}

/*-------------------------------------------------------------------*/
Expand Down

0 comments on commit d03a0b5

Please sign in to comment.