On Wed, Jan 10, 2018 at 04:02:23PM +0100, Jan Kara wrote: > So I don't think this can be a problem. Look, mb_cache_shrink() holds > c_list_lock. It will take first entry from cache->c_list - this list is > using list_head entry->e_list and so we are guaranteed entry->e_list is > non-empty. > > The other place deleting entry - mb_cache_entry_delete() - which is using > different list to grab the entry is properly checking for > !list_empty(entry->e_list) after acquiring c_list_lock. Hmm... you're right. How we handle the hlist_bl_lock and c_list_lock still creeps me out a bit, but it's not going to cause the potential problem. I think there is a problem if mb_cache_entry_create() races with mb_cache_delete(), but that will result in an entry being on the c_list while not being on the hash list, and it doesn't cause the c_entry_count to get out of sync with reality. Drat.... - Ted