Skip to content
Commit 99c07594 authored by Jan Kara's avatar Jan Kara Committed by Greg Kroah-Hartman
Browse files

mbcache: Avoid nesting of cache->c_list_lock under bit locks

commit 5fc4cbd9 upstream.

Commit 307af6c8 ("mbcache: automatically delete entries from cache
on freeing") started nesting cache->c_list_lock under the bit locks
protecting hash buckets of the mbcache hash table in
mb_cache_entry_create(). This causes problems for real-time kernels
because there spinlocks are sleeping locks while bitlocks stay atomic.
Luckily the nesting is easy to avoid by holding entry reference until
the entry is added to the LRU list. This makes sure we cannot race with
entry deletion.

Cc: stable@kernel.org
Fixes: 307af6c8

 ("mbcache: automatically delete entries from cache on freeing")
Reported-by: default avatarMike Galbraith <efault@gmx.de>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220908091032.10513-1-jack@suse.cz


Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d50d6c19
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment