aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4xdr.c
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2013-12-09 06:31:21 -0500
committerJ. Bruce Fields <bfields@redhat.com>2014-01-03 13:44:12 -0500
commita9f7b4a06c9704fa3cfe0b0601347e03289a7407 (patch)
tree271ac8b5e4b40e0b46cdc0634a5637081d33802d /fs/nfsd/nfs4xdr.c
parentb9b284df6c2013aeceb974055426f35e03ac43fc (diff)
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 <kinglongmee@gmail.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/nfs4xdr.c')
-rw-r--r--fs/nfsd/nfs4xdr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 1dface03bd3e..dbd64a9d268b 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -3263,7 +3263,7 @@ nfsd4_do_encode_secinfo(struct nfsd4_compoundres *resp,
3263 3263
3264 if (rpcauth_get_gssinfo(pf, &info) == 0) { 3264 if (rpcauth_get_gssinfo(pf, &info) == 0) {
3265 supported++; 3265 supported++;
3266 RESERVE_SPACE(4 + 4 + info.oid.len + 4 + 4); 3266 RESERVE_SPACE(4 + 4 + XDR_LEN(info.oid.len) + 4 + 4);
3267 WRITE32(RPC_AUTH_GSS); 3267 WRITE32(RPC_AUTH_GSS);
3268 WRITE32(info.oid.len); 3268 WRITE32(info.oid.len);
3269 WRITEMEM(info.oid.data, info.oid.len); 3269 WRITEMEM(info.oid.data, info.oid.len);