r4491 - trunk/varnish-cache/bin/varnishd

phk at projects.linpro.no phk at projects.linpro.no
Mon Jan 25 23:23:31 CET 2010


Author: phk
Date: 2010-01-25 23:23:31 +0100 (Mon, 25 Jan 2010)
New Revision: 4491

Modified:
   trunk/varnish-cache/bin/varnishd/cache_hash.c
Log:
New objcore's didn't get a pointer set to their objhead.

Add a couple of asserts to check that they all do now.



Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_hash.c	2010-01-25 22:05:37 UTC (rev 4490)
+++ trunk/varnish-cache/bin/varnishd/cache_hash.c	2010-01-25 22:23:31 UTC (rev 4491)
@@ -348,6 +348,7 @@
 	VTAILQ_FOREACH(oc, &oh->objcs, list) {
 		/* Must be at least our own ref + the objcore we examine */
 		assert(oh->refcnt > 1);
+		assert(oc->objhead == oh);
 		CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
 
 		if (oc->flags & OC_F_PERSISTENT)
@@ -405,6 +406,7 @@
 	if (oc != NULL) {
 		o = oc->obj;
 		CHECK_OBJ_NOTNULL(o, OBJECT_MAGIC);
+		assert(oc->objhead == oh);
 
 		/* We found an object we like */
 		o->refcnt++;
@@ -438,6 +440,7 @@
 
 	/* XXX: Should this not be ..._HEAD now ? */
 	VTAILQ_INSERT_TAIL(&oh->objcs, oc, list);
+	oc->objhead = oh;
 	/* NB: do not deref objhead the new object inherits our reference */
 	Lck_Unlock(&oh->mtx);
 	*poh = oh;



More information about the varnish-commit mailing list