mirror of
https://github.com/ceph/ceph
synced 2024-12-24 20:33:27 +00:00
cephfs: potential adjust failure in lru_expire
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>
This commit is contained in:
parent
8723353f2b
commit
590c39eab0
@ -157,6 +157,7 @@ public:
|
||||
|
||||
// expire -- expire a single item
|
||||
LRUObject *lru_get_next_expire() {
|
||||
adjust();
|
||||
// look through tail of bot
|
||||
while (bottom.size()) {
|
||||
LRUObject *p = bottom.back();
|
||||
@ -164,7 +165,6 @@ public:
|
||||
|
||||
// move to pintail
|
||||
pintail.push_front(&p->lru_link);
|
||||
adjust();
|
||||
}
|
||||
|
||||
// ok, try head then
|
||||
@ -174,7 +174,6 @@ public:
|
||||
|
||||
// move to pintail
|
||||
pintail.push_front(&p->lru_link);
|
||||
adjust();
|
||||
}
|
||||
|
||||
// no luck!
|
||||
|
Loading…
Reference in New Issue
Block a user