Commit 4204f4ba authored by Chuck Lever's avatar Chuck Lever Committed by Ben Hutchings

NFS: Fix size of NFSACL SETACL operations

commit d683cc49 upstream.

When encoding the NFSACL SETACL operation, reserve just the estimated
size of the ACL rather than a fixed maximum. This eliminates needless
zero padding on the wire that the server ignores.

Fixes: ee5dc773 ('NFS: Fix "kernel BUG at fs/nfs/nfs3xdr.c:1338!"')
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent ef8500b1
...@@ -1333,7 +1333,7 @@ static void nfs3_xdr_enc_setacl3args(struct rpc_rqst *req, ...@@ -1333,7 +1333,7 @@ static void nfs3_xdr_enc_setacl3args(struct rpc_rqst *req,
if (args->npages != 0) if (args->npages != 0)
xdr_write_pages(xdr, args->pages, 0, args->len); xdr_write_pages(xdr, args->pages, 0, args->len);
else else
xdr_reserve_space(xdr, NFS_ACL_INLINE_BUFSIZE); xdr_reserve_space(xdr, args->len);
error = nfsacl_encode(xdr->buf, base, args->inode, error = nfsacl_encode(xdr->buf, base, args->inode,
(args->mask & NFS_ACL) ? (args->mask & NFS_ACL) ?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment