Skip to content

Commit 8c04ef5

Browse files
committed
SQUASHME: fix incorrect assertion
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.
1 parent cf932ca commit 8c04ef5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bin/varnishd/cache/cache_hash.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -955,8 +955,8 @@ HSH_Withdraw(struct worker *wrk, struct objcore **ocp)
955955
assert(oc->refcnt == 1);
956956
assert(oh->refcnt > 0);
957957
oc->flags = OC_F_WITHDRAWN;
958-
hsh_rush1(wrk, oc, &rush);
959-
AZ(HSH_DerefObjCoreUnlock(wrk, &oc));
958+
hsh_rush1(wrk, oc, &rush); /* grabs up to 1 oc ref */
959+
assert(HSH_DerefObjCoreUnlock(wrk, &oc) <= 1);
960960

961961
hsh_rush2(wrk, &rush);
962962

0 commit comments

Comments
 (0)