]> git.baikalelectronics.ru Git - kernel.git/commit
svcrdma: Fix leak of svc_rdma_recv_ctxt objects
authorChuck Lever <chuck.lever@oracle.com>
Tue, 31 Mar 2020 21:02:33 +0000 (17:02 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Fri, 17 Apr 2020 16:40:38 +0000 (12:40 -0400)
commitd896a13650aef5c3750dd75d3102087b4b2241d0
tree1a73588d0635ff9380725408c9cee6113ae89e9a
parent7df1b71f0435f4289b4549e749e86ca6b8c08ff4
svcrdma: Fix leak of svc_rdma_recv_ctxt objects

Utilize the xpo_release_rqst transport method to ensure that each
rqstp's svc_rdma_recv_ctxt object is released even when the server
cannot return a Reply for that rqstp.

Without this fix, each RPC whose Reply cannot be sent leaks one
svc_rdma_recv_ctxt. This is a 2.5KB structure, a 4KB DMA-mapped
Receive buffer, and any pages that might be part of the Reply
message.

The leak is infrequent unless the network fabric is unreliable or
Kerberos is in use, as GSS sequence window overruns, which result
in connection loss, are more common on fast transports.

Fixes: 390a88f4cc8b ("svcrdma: Preserve Receive buffer until svc_rdma_sendto")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
include/linux/sunrpc/svc_rdma.h
net/sunrpc/svc_xprt.c
net/sunrpc/svcsock.c
net/sunrpc/xprtrdma/svc_rdma_recvfrom.c
net/sunrpc/xprtrdma/svc_rdma_sendto.c
net/sunrpc/xprtrdma/svc_rdma_transport.c