linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: anna.schumaker@netapp.com
Cc: linux-rdma@vger.kernel.org, linux-nfs@vger.kernel.org
Subject: [PATCH v3 01/12] xprtrdma: Cap size of callback buffer resources
Date: Tue, 29 Nov 2016 10:52:08 -0500	[thread overview]
Message-ID: <20161129155208.23061.9596.stgit@manet.1015granger.net> (raw)
In-Reply-To: <20161129154845.23061.29385.stgit@manet.1015granger.net>

When the inline threshold size is set to large values (say, 32KB)
any NFSv4.1 CB request from the server gets a reply with status
NFS4ERR_RESOURCE.

Looks like there are some upper layer assumptions about the maximum
size of a reply (for example, in process_op). Cap the size of the
NFSv4 client's reply resources at a page.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---
 net/sunrpc/xprtrdma/backchannel.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/sunrpc/xprtrdma/backchannel.c b/net/sunrpc/xprtrdma/backchannel.c
index 2c472e1..24fedd4 100644
--- a/net/sunrpc/xprtrdma/backchannel.c
+++ b/net/sunrpc/xprtrdma/backchannel.c
@@ -55,7 +55,8 @@ static int rpcrdma_bc_setup_rqst(struct rpcrdma_xprt *r_xprt,
 	if (IS_ERR(rb))
 		goto out_fail;
 	req->rl_sendbuf = rb;
-	xdr_buf_init(&rqst->rq_snd_buf, rb->rg_base, size);
+	xdr_buf_init(&rqst->rq_snd_buf, rb->rg_base,
+		     min_t(size_t, size, PAGE_SIZE));
 	rpcrdma_set_xprtdata(rqst, req);
 	return 0;
 
@@ -191,6 +192,7 @@ size_t xprt_rdma_bc_maxpayload(struct rpc_xprt *xprt)
 	size_t maxmsg;
 
 	maxmsg = min_t(unsigned int, cdata->inline_rsize, cdata->inline_wsize);
+	maxmsg = min_t(unsigned int, maxmsg, PAGE_SIZE);
 	return maxmsg - RPCRDMA_HDRLEN_MIN;
 }
 


  reply	other threads:[~2016-11-29 15:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-29 15:51 [PATCH v3 00/12] client-side NFS/RDMA patches proposed for v4.10 Chuck Lever
2016-11-29 15:52 ` Chuck Lever [this message]
2016-11-29 15:52 ` [PATCH v3 02/12] xprtrdma: Make FRWR send queue entry accounting more accurate Chuck Lever
2016-11-29 15:52 ` [PATCH v3 03/12] xprtrdma: Support for SG_GAP devices Chuck Lever
2016-11-29 15:52 ` [PATCH v3 04/12] SUNRPC: Proper metric accounting when RPC is not transmitted Chuck Lever
2016-11-29 15:52 ` [PATCH v3 05/12] xprtrdma: Address coverity complaint about wait_for_completion() Chuck Lever
2016-11-29 15:52 ` [PATCH v3 06/12] xprtrdma: Avoid calls to ro_unmap_safe() Chuck Lever
2016-11-29 15:52 ` [PATCH v3 07/12] xprtrdma: Refactor FRMR invalidation Chuck Lever
2016-11-29 15:53 ` [PATCH v3 08/12] xprtrdma: Update documenting comment Chuck Lever
2016-11-29 15:53 ` [PATCH v3 09/12] xprtrdma: Squelch "max send, max recv" messages at connect time Chuck Lever
2016-11-29 15:53 ` [PATCH v3 10/12] xprtrdma: Shorten QP access error message Chuck Lever
2016-11-29 15:53 ` [PATCH v3 11/12] xprtrdma: Update dprintk in rpcrdma_count_chunks Chuck Lever
2016-11-29 15:53 ` [PATCH v3 12/12] xprtrdma: Relocate connection helper functions Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161129155208.23061.9596.stgit@manet.1015granger.net \
    --to=chuck.lever@oracle.com \
    --cc=anna.schumaker@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).