[master] 60a6aba69 Deref the objhead if we don't return a busy object.

Poul-Henning Kamp phk at FreeBSD.org
Tue Sep 4 10:18:10 UTC 2018


commit 60a6aba69ac02f2ba78a8df0a7df98d77294991f
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Sep 4 10:15:52 2018 +0000

    Deref the objhead if we don't return a busy object.
    
    Most of the heavy lifting by:   slink
    
    Fixes: #2760, #2754, #2654

diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c
index 182a7a97d..bb32d4fc2 100644
--- a/bin/varnishd/cache/cache_hash.c
+++ b/bin/varnishd/cache/cache_hash.c
@@ -460,7 +460,7 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp,
 			}
 			Lck_Unlock(&oh->mtx);
 			*ocp = oc;
-			if (retval == HSH_HIT)
+			if (*bocp == NULL)
 				assert(HSH_DerefObjHead(wrk, &oh));
 			return (retval);
 		}


More information about the varnish-commit mailing list