提交 2d5b3a48 编写于 作者: T Trond Myklebust 提交者: Yang Yingliang

sunrpc: Fix potential leaks in sunrpc_cache_unhash()

mainline inclusion
from mainline-v5.6-rc1
commit 1d821637
category: bugfix
bugzilla: 51810
CVE: NA

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

When we unhash the cache entry, we need to handle any pending upcalls
by calling cache_fresh_unlocked().
Signed-off-by: NTrond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: NJ. Bruce Fields <bfields@redhat.com>
Signed-off-by: NLu Wei <luwei32@huawei.com>
Reviewed-by: NYue Haibing <yuehaibing@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 b7282525
...@@ -1855,7 +1855,9 @@ void sunrpc_cache_unhash(struct cache_detail *cd, struct cache_head *h) ...@@ -1855,7 +1855,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(&h->cache_list); hlist_del_init(&h->cache_list);
cd->entries--; cd->entries--;
set_bit(CACHE_CLEANED, &h->flags);
write_unlock(&cd->hash_lock); write_unlock(&cd->hash_lock);
cache_fresh_unlocked(h, cd);
cache_put(h, cd); cache_put(h, cd);
} else } else
write_unlock(&cd->hash_lock); write_unlock(&cd->hash_lock);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册