J. Bruce Fields wrote: > On Wed, Jan 24, 2007 at 02:20:20PM -0500, Chuck Lever wrote: >> @@ -753,25 +751,39 @@ call_reserveresult(struct rpc_task *task >> static void >> call_allocate(struct rpc_task *task) >> { >> + unsigned int slack = task->tk_auth->au_cslack; >> struct rpc_rqst *req = task->tk_rqstp; >> struct rpc_xprt *xprt = task->tk_xprt; >> - unsigned int bufsiz; >> + struct rpc_procinfo *proc = task->tk_msg.rpc_proc; >> >> dprint_status(task); >> >> + task->tk_status = 0; >> task->tk_action = call_bind; >> + >> if (req->rq_buffer) >> return; >> >> - /* FIXME: compute buffer requirements more exactly using >> - * auth->au_wslack */ >> - bufsiz = task->tk_msg.rpc_proc->p_bufsiz + RPC_SLACK_SPACE; >> + if (proc->p_proc != 0) { >> + BUG_ON(proc->p_arglen == 0); >> + if (proc->p_decode != NULL) >> + BUG_ON(proc->p_replen == 0); >> + } >> >> - req->rq_buffer = xprt->ops->buf_alloc(task, bufsiz << 1); >> - if (req->rq_buffer != NULL) { >> - req->rq_bufsize = bufsiz; >> + /* >> + * Calculate the size (in quads) of the RPC call >> + * and reply headers, and convert both values >> + * to byte sizes. >> + */ >> + req->rq_callsize = RPC_CALLHDRSIZE + (slack << 1) + proc->p_arglen; >> + req->rq_callsize <<= 2; >> + req->rq_rcvsize = RPC_REPHDRSIZE + slack + proc->p_replen; >> + req->rq_rcvsize <<= 2; > > What happened to rslack? The callsize calculation should be using > cslack and the rcvsize calculation rslack, I think, right? As far as I understood it, cslack is the size of the authentication verifier for that flavor. Shouldn't that be the same for calls and replies? > In the krb5p case there's an extra annoyance: rslack is used to decide > where to expect page data to start, so it can only take into account > extra space needed at the beginning. But krb5p has to add padding, for > example, to the end of each request. That padding has to follow XDR rules, though, correct?