diff options
author | dormando <dormando@rydia.net> | 2012-01-08 20:23:46 -0800 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2012-01-08 20:23:46 -0800 |
commit | 324975cee252e7d28496a238334c22eba6d7cda1 (patch) | |
tree | d475a9c9a41a459faddb6dadfe2ae8b5e1daec3b | |
parent | 193a653e9678080f5ef7841ce93dca8e24116949 (diff) | |
download | memcached-324975cee252e7d28496a238334c22eba6d7cda1.tar.gz |
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.
-rw-r--r-- | slabs.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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 { |