Commit 46a40c53 authored by Jan Kara's avatar Jan Kara Committed by zhaoxiaoqiang11
Browse files

mbcache: automatically delete entries from cache on freeing

stable inclusion
from stable-v5.10.163
commit 0da99012d3f7ccec903e9db4013647e1b831bced
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7PJ9N

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0da99012d3f7ccec903e9db4013647e1b831bced



----------------------------------------------------

[ Upstream commit 307af6c8 ]

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: default avatarJan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220712105436.32204-10-jack@suse.cz


Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
Stable-dep-of: a44e84a9 ("ext4: fix deadlock due to mbcache entry corruption")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarzhaoxiaoqiang11 <zhaoxiaoqiang11@jd.com>
parent ec2e3da1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment