ext4: remove EA inode entry from mbcache on inode eviction
[ Upstream commit 6bc0d63dad7f9f54d381925ee855b402f652fa39 ]
Currently we remove EA inode from mbcache as soon as its xattr refcount
drops to zero. However there can be pending attempts to reuse the inode
and thus refcount handling code has to handle the situation when
refcount increases from zero anyway. So save some work and just keep EA
inode in mbcache until it is getting evicted. At that moment we are sure
following iget() of EA inode will fail anyway (or wait for eviction to
finish and load things from the disk again) and so removing mbcache
entry at that moment is fine and simplifies the code a bit.
CC: stable@vger.kernel.org
Fixes: 82939d7999 ("ext4: convert to mbcache2")
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220712105436.32204-3-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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8a9ce3a5b7
commit
bb337d8dd1
@@ -207,6 +207,8 @@ void ext4_evict_inode(struct inode *inode)
|
||||
|
||||
trace_ext4_evict_inode(inode);
|
||||
|
||||
if (EXT4_I(inode)->i_flags & EXT4_EA_INODE_FL)
|
||||
ext4_evict_ea_inode(inode);
|
||||
if (inode->i_nlink) {
|
||||
/*
|
||||
* When journalling data dirty buffers are tracked only in the
|
||||
|
||||
Reference in New Issue
Block a user