xprtrdma: Return -ENOBUFS when no pages are available
authorChuck Lever <chuck.lever@oracle.com>
Fri, 4 May 2018 19:35:46 +0000 (15:35 -0400)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Fri, 1 Jun 2018 17:56:30 +0000 (13:56 -0400)
The use of -EAGAIN in rpcrdma_convert_iovs() is a latent bug: the
transport never calls xprt_write_space() when more pages become
available. -ENOBUFS will trigger the correct "delay briefly and call
again" logic.

Fixes: 7a89f9c626e3 ("xprtrdma: Honor ->send_request API contract")
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Cc: stable@vger.kernel.org # 4.8+
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
net/sunrpc/xprtrdma/rpc_rdma.c

index d676106295ff183d074f75356b591826af065ada..1d7857919d3df0bd96f8f357b8e9b1d745921eaf 100644 (file)
@@ -231,7 +231,7 @@ rpcrdma_convert_iovs(struct rpcrdma_xprt *r_xprt, struct xdr_buf *xdrbuf,
                         */
                        *ppages = alloc_page(GFP_ATOMIC);
                        if (!*ppages)
-                               return -EAGAIN;
+                               return -ENOBUFS;
                }
                seg->mr_page = *ppages;
                seg->mr_offset = (char *)page_base;