]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
svcrpc: fix svc_xprt_enqueue/svc_recv busy-looping
authorJ. Bruce Fields <bfields@redhat.com>
Fri, 17 Aug 2012 21:31:53 +0000 (17:31 -0400)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 20 Aug 2012 22:39:19 +0000 (18:39 -0400)
commitd10f27a750312ed5638c876e4bd6aa83664cccd8
tree9d6c68a078bc5129080177829d531d2686ea4e2a
parentf06f00a24d76e168ecb38d352126fd203937b601
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: Michael Tokarev <mjt@tls.msk.ru>
Tested-by: Michael Tokarev <mjt@tls.msk.ru>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
net/sunrpc/svc_xprt.c