]> git.baikalelectronics.ru Git - kernel.git/commit
SUNRPC: Drop all entries from cache_detail when cache_purge()
authorKinglong Mee <kinglongmee@gmail.com>
Wed, 8 Feb 2017 01:54:33 +0000 (09:54 +0800)
committerJ. Bruce Fields <bfields@redhat.com>
Wed, 8 Feb 2017 21:49:32 +0000 (16:49 -0500)
commit1ebef838cd16930ac28c830c080bc991be0da26b
tree0b4cc18a4de82c303aceaa5ab72511acf21ebace
parentfb79e65241a711f3018e7b8a79ab280ed5a0b2ef
SUNRPC: Drop all entries from cache_detail when cache_purge()

User always free the cache_detail after sunrpc_destroy_cache_detail(),
so, it must cleanup up entries that left in the cache_detail,
otherwise, NULL reference may be caused when using the left entries.

Also, NeriBrown suggests "write a stand-alone cache_purge()."

v3, move the cache_fresh_unlocked() out of write lock,
v2, a stand-alone cache_purge(), not only for sunrpc_destroy_cache_detail

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
Reviewed-by: NeilBrown <neilb@suse.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
net/sunrpc/cache.c