Commit 96ce8210 authored by Ralf Haferkamp's avatar Ralf Haferkamp
Browse files

ITS#6341 removal of last entry from cache caused corruption in the lru list

parent 68b914d7
......@@ -106,10 +106,14 @@ bdb_cache_entryinfo_free( Cache *cache, EntryInfo *ei )
}
#define LRU_DEL( c, e ) do { \
if ( e == (c)->c_lruhead ) (c)->c_lruhead = e->bei_lruprev; \
if ( e == (c)->c_lrutail ) (c)->c_lrutail = e->bei_lruprev; \
e->bei_lrunext->bei_lruprev = e->bei_lruprev; \
e->bei_lruprev->bei_lrunext = e->bei_lrunext; \
if ( e == e->bei_lruprev ) { \
(c)->c_lruhead = (c)->c_lrutail = NULL; \
} else { \
if ( e == (c)->c_lruhead ) (c)->c_lruhead = e->bei_lruprev; \
if ( e == (c)->c_lrutail ) (c)->c_lrutail = e->bei_lruprev; \
e->bei_lrunext->bei_lruprev = e->bei_lruprev; \
e->bei_lruprev->bei_lrunext = e->bei_lrunext; \
} \
e->bei_lruprev = NULL; \
} while ( 0 )
......
Supports Markdown
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