Commit d9f9a945 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add another band-aid suicide clause when we run out of space in the silo.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4275 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent 821ebfee
......@@ -46,6 +46,7 @@ SVNID("$Id$")
#include <sys/param.h>
#include <sys/mman.h>
#include "shmlog.h"
#include "cache.h"
#include "stevedore.h"
#include "hash_slinger.h"
......@@ -1063,6 +1064,17 @@ smp_new_seg(struct smp_sc *sc)
sg->length = sc->aim_segl;
sg->length &= ~7;
if (sg->offset + sg->length > sc->mediasize) {
sc->free_offset = sc->ident->stuff[SMP_SPC_STUFF];
sg->offset = sc->free_offset;
sg2 = VTAILQ_FIRST(&sc->segments);
if (sg->offset + sg->length > sg2->offset) {
printf("Out of space in persistent silo\n");
printf("Committing suicide, restart will make space\n");
exit (0);
}
}
assert(sg->offset + sg->length <= sc->mediasize);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment