Fix: the first adjust is no needed,it will never take real effect.
the second 'adjust' may never get the chance to be executed
suppose we can reach the second 'adjust', it will crash because the bottom list is empty now.
Fixes: http://tracker.ceph.com/issues/22458
Signed-off-by: dongdong tao <tdd21151186@gmail.com>
// expire -- expire a single item
LRUObject *lru_get_next_expire() {
+ adjust();
// look through tail of bot
while (bottom.size()) {
LRUObject *p = bottom.back();
// move to pintail
pintail.push_front(&p->lru_link);
- adjust();
}
// ok, try head then
// move to pintail
pintail.push_front(&p->lru_link);
- adjust();
}
// no luck!