mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-15 16:24:13 +08:00
sunrpc: Fix potential leaks in sunrpc_cache_unhash()
[ Upstream commit 1d82163714
]
When we unhash the cache entry, we need to handle any pending upcalls
by calling cache_fresh_unlocked().
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
46503858e2
commit
707518c16b
@ -1888,7 +1888,9 @@ void sunrpc_cache_unhash(struct cache_detail *cd, struct cache_head *h)
|
||||
if (!hlist_unhashed(&h->cache_list)){
|
||||
hlist_del_init_rcu(&h->cache_list);
|
||||
cd->entries--;
|
||||
set_bit(CACHE_CLEANED, &h->flags);
|
||||
spin_unlock(&cd->hash_lock);
|
||||
cache_fresh_unlocked(h, cd);
|
||||
cache_put(h, cd);
|
||||
} else
|
||||
spin_unlock(&cd->hash_lock);
|
||||
|
Loading…
Reference in New Issue
Block a user