Skip to content
Commit d10f27a7 authored by J. Bruce Fields's avatar J. Bruce Fields
Browse files

svcrpc: fix svc_xprt_enqueue/svc_recv busy-looping



The rpc server tries to ensure that there will be room to send a reply
before it receives a request.

It does this by tracking, in xpt_reserved, an upper bound on the total
size of the replies that is has already committed to for the socket.

Currently it is adding in the estimate for a new reply *before* it
checks whether there is space available.  If it finds that there is not
space, it then subtracts the estimate back out.

This may lead the subsequent svc_xprt_enqueue to decide that there is
space after all.

The results is a svc_recv() that will repeatedly return -EAGAIN, causing
server threads to loop without doing any actual work.

Cc: stable@vger.kernel.org
Reported-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
Tested-by: default avatarMichael Tokarev <mjt@tls.msk.ru>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent f06f00a2
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