Commit 1d821637 authored by Trond Myklebust's avatar Trond Myklebust Committed by J. Bruce Fields

sunrpc: Fix potential leaks in sunrpc_cache_unhash()

When we unhash the cache entry, we need to handle any pending upcalls
by calling cache_fresh_unlocked().
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 1b28d756
...@@ -1888,7 +1888,9 @@ void sunrpc_cache_unhash(struct cache_detail *cd, struct cache_head *h) ...@@ -1888,7 +1888,9 @@ void sunrpc_cache_unhash(struct cache_detail *cd, struct cache_head *h)
if (!hlist_unhashed(&h->cache_list)){ if (!hlist_unhashed(&h->cache_list)){
hlist_del_init_rcu(&h->cache_list); hlist_del_init_rcu(&h->cache_list);
cd->entries--; cd->entries--;
set_bit(CACHE_CLEANED, &h->flags);
spin_unlock(&cd->hash_lock); spin_unlock(&cd->hash_lock);
cache_fresh_unlocked(h, cd);
cache_put(h, cd); cache_put(h, cd);
} else } else
spin_unlock(&cd->hash_lock); spin_unlock(&cd->hash_lock);
......
Markdown is supported
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