]> git.baikalelectronics.ru Git - kernel.git/commit
mbcache: automatically delete entries from cache on freeing
authorJan Kara <jack@suse.cz>
Tue, 12 Jul 2022 10:54:29 +0000 (12:54 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:56 +0000 (11:41 +0100)
commitfa8608133025ce964328f15fa9fbd49d7f1e4c93
tree7f8c50a09e7ec94a3703eaf2da0fdfc7f102ec53
parent591e67dc68f6df7c14b9b4db2e10a5ae27b04f89
mbcache: automatically delete entries from cache on freeing

[ Upstream commit 8996bd12f3192767fc48adb918adb8b25bb3c773 ]

Use the fact that entries with elevated refcount are not removed from
the hash and just move removal of the entry from the hash to the entry
freeing time. When doing this we also change the generic code to hold
one reference to the cache entry, not two of them, which makes code
somewhat more obvious.

Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220712105436.32204-10-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Stable-dep-of: a44e84a9b776 ("ext4: fix deadlock due to mbcache entry corruption")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/mbcache.c
include/linux/mbcache.h