From 324975cee252e7d28496a238334c22eba6d7cda1 Mon Sep 17 00:00:00 2001 From: dormando Date: Sun, 8 Jan 2012 20:23:46 -0800 Subject: [PATCH] fix braindead linked list fail I re-implemented a linked list for the slab freelist since we don't need to manage the tail, check the previous item, and use it as a FIFO. However prev/next must be managed so the slab mover is safe. However I neglected to clear prev on a fetch, so if the slab mover was zeroing the head of the freelist it would relink the next item in the freelist with one in the main LRU. Which results in chaos. --- slabs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/slabs.c b/slabs.c index c56b678f10..6029c34ca4 100644 --- a/slabs.c +++ b/slabs.c @@ -249,6 +249,7 @@ static void *do_slabs_alloc(const size_t size, unsigned int id) { /* return off our freelist */ it = (item *)p->slots; p->slots = it->next; + if (it->next) it->next->prev = 0; p->sl_curr--; ret = (void *)it; } else {