nfsd4: better reservation of head space for krb5
RPC_MAX_AUTH_SIZE is scattered around several places. Better to set it once in the auth code, where this kind of estimate should be made. And while we're at it we can leave it zero when we're not using krb5i or krb5p. Signed-off-by: J. Bruce Fields <bfields@redhat.com>
This commit is contained in:
@@ -1611,7 +1611,8 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
|
||||
DECODE_HEAD;
|
||||
struct nfsd4_op *op;
|
||||
bool cachethis = false;
|
||||
int max_reply = 2 * RPC_MAX_AUTH_SIZE + 8; /* opcnt, status */
|
||||
int auth_slack= argp->rqstp->rq_auth_slack;
|
||||
int max_reply = auth_slack + 8; /* opcnt, status */
|
||||
int readcount = 0;
|
||||
int readbytes = 0;
|
||||
int i;
|
||||
@@ -1677,7 +1678,7 @@ nfsd4_decode_compound(struct nfsd4_compoundargs *argp)
|
||||
svc_reserve(argp->rqstp, max_reply + readbytes);
|
||||
argp->rqstp->rq_cachetype = cachethis ? RC_REPLBUFF : RC_NOCACHE;
|
||||
|
||||
if (readcount > 1 || max_reply > PAGE_SIZE - 2*RPC_MAX_AUTH_SIZE)
|
||||
if (readcount > 1 || max_reply > PAGE_SIZE - auth_slack)
|
||||
argp->rqstp->rq_splice_ok = false;
|
||||
|
||||
DECODE_TAIL;
|
||||
|
Reference in New Issue
Block a user