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>
(cherry picked from commit
590c39eab02e64de7393c35ae7a9efb6ce626770)
// 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!