[PATCH 08/13] Add an assert that segment rounding doesn't overstep our previous allocation calculations.

Martin Blix Grydeland martin at varnish-software.com
Mon Oct 1 12:26:15 CEST 2012


---
 bin/varnishd/storage/storage_persistent_silo.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/varnishd/storage/storage_persistent_silo.c b/bin/varnishd/storage/storage_persistent_silo.c
index 0014647..cc4a060 100644
--- a/bin/varnishd/storage/storage_persistent_silo.c
+++ b/bin/varnishd/storage/storage_persistent_silo.c
@@ -218,6 +218,7 @@ smp_new_seg(struct smp_sc *sc)
 
 	sg->p.offset = IRNUP(sc, sg->p.offset);
 	sg->p.length = IRNDN(sc, sg->p.length);
+	assert(sg->p.offset + sg->p.length <= tmpsg.p.offset + tmpsg.p.length);
 	sc->free_offset = sg->p.offset + sg->p.length;
 
 	VTAILQ_INSERT_TAIL(&sc->segments, sg, list);
-- 
1.7.9.5




More information about the varnish-dev mailing list