From: Kinglong Mee Date: Mon, 9 Dec 2013 11:31:21 +0000 (+0800) Subject: nfsd: clean up an xdr reserved space calculation X-Git-Tag: v3.14-rc1~44^2~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a9f7b4a06c9704fa3cfe0b0601347e03289a7407;p=profile%2Fivi%2Fkernel-x86-ivi.git nfsd: clean up an xdr reserved space calculation We should use XDR_LEN to calculate reserved space in case the oid is not a multiple of 4. RESERVE_SPACE actually rounds up for us, but it's probably better to be careful here. Signed-off-by: Kinglong Mee Signed-off-by: J. Bruce Fields --- diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 1dface0..dbd64a9 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -3263,7 +3263,7 @@ nfsd4_do_encode_secinfo(struct nfsd4_compoundres *resp, if (rpcauth_get_gssinfo(pf, &info) == 0) { supported++; - RESERVE_SPACE(4 + 4 + info.oid.len + 4 + 4); + RESERVE_SPACE(4 + 4 + XDR_LEN(info.oid.len) + 4 + 4); WRITE32(RPC_AUTH_GSS); WRITE32(info.oid.len); WRITEMEM(info.oid.data, info.oid.len);