diff options
author | J. Bruce Fields <bfields@redhat.com> | 2011-01-02 21:28:34 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2011-01-04 16:49:21 -0500 |
commit | d76d1815f3e72fb627ad7f95ef63120b0a557c9c (patch) | |
tree | e639629aabf50fe9b5441286ff12cfc4ec77de98 /net/sunrpc/xprt.c | |
parent | 3beb6cd1d448e7ded938bbd676493e6a08e9a6cd (diff) | |
download | linux-stable-d76d1815f3e72fb627ad7f95ef63120b0a557c9c.tar.gz linux-stable-d76d1815f3e72fb627ad7f95ef63120b0a557c9c.tar.bz2 linux-stable-d76d1815f3e72fb627ad7f95ef63120b0a557c9c.zip |
svcrpc: avoid double reply caused by deferral race
Commit d29068c431599fa "sunrpc: Simplify cache_defer_req and related
functions." asserted that cache_check() could determine success or
failure of cache_defer_req() by checking the CACHE_PENDING bit.
This isn't quite right.
We need to know whether cache_defer_req() created a deferred request,
in which case sending an rpc reply has become the responsibility of the
deferred request, and it is important that we not send our own reply,
resulting in two different replies to the same request.
And the CACHE_PENDING bit doesn't tell us that; we could have
succesfully created a deferred request at the same time as another
thread cleared the CACHE_PENDING bit.
So, partially revert that commit, to ensure that cache_check() returns
-EAGAIN if and only if a deferred request has been created.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Acked-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'net/sunrpc/xprt.c')
0 files changed, 0 insertions, 0 deletions