[master] 9f3100e Take offset rounding into account when rounding the length of segment size.

Martin Blix Grydeland martin at varnish-software.com
Tue Apr 8 14:59:19 CEST 2014


commit 9f3100e298e079d75fe4e448d5b1b4e26cb2606e
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Tue Apr 8 14:57:09 2014 +0200

    Take offset rounding into account when rounding the length of segment
    size.
    
    Fixes: #1469

diff --git a/bin/varnishd/storage/storage_persistent_silo.c b/bin/varnishd/storage/storage_persistent_silo.c
index 35af470..f27ccd9 100644
--- a/bin/varnishd/storage/storage_persistent_silo.c
+++ b/bin/varnishd/storage/storage_persistent_silo.c
@@ -219,6 +219,7 @@ smp_new_seg(struct smp_sc *sc)
 	sg->lru->flags |= LRU_F_DONTMOVE;
 
 	sg->p.offset = IRNUP(sc, sg->p.offset);
+	sg->p.length -= sg->p.offset - tmpsg.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;



More information about the varnish-commit mailing list