mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 01:49:36 +00:00
SUNRPC: Fix the minimal size for reply buffer allocation
We must at minimum allocate enough memory to be able to see any auth
errors in the reply from the server.
Fixes: 2c94b8eca1
("SUNRPC: Use au_rslack when computing reply...")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
This commit is contained in:
parent
9734ad57b0
commit
513149607d
1 changed files with 6 additions and 1 deletions
|
@ -1730,7 +1730,12 @@ call_allocate(struct rpc_task *task)
|
|||
req->rq_callsize = RPC_CALLHDRSIZE + (auth->au_cslack << 1) +
|
||||
proc->p_arglen;
|
||||
req->rq_callsize <<= 2;
|
||||
req->rq_rcvsize = RPC_REPHDRSIZE + auth->au_rslack + proc->p_replen;
|
||||
/*
|
||||
* Note: the reply buffer must at minimum allocate enough space
|
||||
* for the 'struct accepted_reply' from RFC5531.
|
||||
*/
|
||||
req->rq_rcvsize = RPC_REPHDRSIZE + auth->au_rslack + \
|
||||
max_t(size_t, proc->p_replen, 2);
|
||||
req->rq_rcvsize <<= 2;
|
||||
|
||||
status = xprt->ops->buf_alloc(task);
|
||||
|
|
Loading…
Reference in a new issue