rm = list_entry(tree->buffer_lru.prev,
struct extent_buffer, lru);
tree->lru_size--;
- list_del(&rm->lru);
+ list_del_init(&rm->lru);
free_extent_buffer(rm);
}
} else
return eb;
fail:
+ spin_lock(&tree->lru_lock);
+ list_del_init(&eb->lru);
+ spin_unlock(&tree->lru_lock);
if (!atomic_dec_and_test(&eb->refs))
return NULL;
for (index = 0; index < i; index++) {
spin_unlock(&tree->lru_lock);
return eb;
fail:
+ spin_lock(&tree->lru_lock);
+ list_del_init(&eb->lru);
+ spin_unlock(&tree->lru_lock);
if (!atomic_dec_and_test(&eb->refs))
return NULL;
for (index = 0; index < i; index++) {