Skip to content

Commit

Permalink
SQUASHME: fix incorrect assertion
Browse files Browse the repository at this point in the history
The expectation that withdrawing would drop the last reference was
inferred from the assertion on having the sole reference a few lines
above. Except that we grant up to one request a reference to the oc
before we rush it.
  • Loading branch information
dridi committed Mar 4, 2024
1 parent cf932ca commit 8c04ef5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/varnishd/cache/cache_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,8 +955,8 @@ HSH_Withdraw(struct worker *wrk, struct objcore **ocp)
assert(oc->refcnt == 1);
assert(oh->refcnt > 0);
oc->flags = OC_F_WITHDRAWN;
hsh_rush1(wrk, oc, &rush);
AZ(HSH_DerefObjCoreUnlock(wrk, &oc));
hsh_rush1(wrk, oc, &rush); /* grabs up to 1 oc ref */
assert(HSH_DerefObjCoreUnlock(wrk, &oc) <= 1);

hsh_rush2(wrk, &rush);

Expand Down

0 comments on commit 8c04ef5

Please sign in to comment.