Commit 17068466 authored by Trond Myklebust's avatar Trond Myklebust

NFSv4: Fix open coded xdr_stream_remaining()

Signed-off-by: default avatarTrond Myklebust <trond.myklebust@hammerspace.com>
parent eee1f549
......@@ -5337,11 +5337,11 @@ static int decode_getacl(struct xdr_stream *xdr, struct rpc_rqst *req,
res->acl_len = attrlen;
/* Check for receive buffer overflow */
if (res->acl_len > (xdr->nwords << 2) ||
if (res->acl_len > xdr_stream_remaining(xdr) ||
res->acl_len + res->acl_data_offset > xdr->buf->page_len) {
res->acl_flags |= NFS4_ACL_TRUNC;
dprintk("NFS: acl reply: attrlen %u > page_len %u\n",
attrlen, xdr->nwords << 2);
dprintk("NFS: acl reply: attrlen %u > page_len %zu\n",
attrlen, xdr_stream_remaining(xdr));
}
} else
status = -EOPNOTSUPP;
......
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