]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
sunrpc/cache: drop reference when sunrpc_cache_pipe_upcall() detects a race
authorNeilBrown <neilb@suse.com>
Fri, 4 Mar 2016 06:20:13 +0000 (17:20 +1100)
committerKamal Mostafa <kamal@canonical.com>
Mon, 16 May 2016 17:27:16 +0000 (10:27 -0700)
commit2de7d61dde696a69e22596821693a1ad5640c2db
tree56d2bfe993356b74ed1c96904f3a69d8507e6c9d
parente824ba2fe01c5256b0c77c54b9b81e240a502dd3
sunrpc/cache: drop reference when sunrpc_cache_pipe_upcall() detects a race

BugLink: http://bugs.launchpad.net/bugs/1578798
commit a6ab1e8126d205238defbb55d23661a3a5c6a0d8 upstream.

sunrpc_cache_pipe_upcall() can detect a race if CACHE_PENDING is no longer
set.  In this case it aborts the queuing of the upcall.
However it has already taken a new counted reference on "h" and
doesn't "put" it, even though it frees the data structure holding the reference.

So let's delay the "cache_get" until we know we need it.

Fixes: f9e1aedc6c79 ("sunrpc/cache: remove races with queuing an upcall.")
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
net/sunrpc/cache.c