Commit 95832998 authored by Jeff Layton's avatar Jeff Layton Committed by Anna Schumaker

nfs: fix bitmap decoder to handle a 3rd word

It only decodes the first two words at this point. Have it decode the
third word as well. Without this, the client doesn't send delegated
timestamps in the CB_GETATTR response.

With this change we also need to expand the on-stack bitmap in
decode_recallany_args to 3 elements, in case the server sends a larger
bitmap than expected.

Fixes: 43df7110 ("NFSv4: Add CB_GETATTR support for delegated attributes")
Signed-off-by: default avatarJeff Layton <jlayton@kernel.org>
Reviewed-by: default avatarBenjamin Coddington <bcodding@redhat.com>
Signed-off-by: default avatarAnna Schumaker <Anna.Schumaker@Netapp.com>
parent cb78f9b7
...@@ -118,7 +118,9 @@ static __be32 decode_bitmap(struct xdr_stream *xdr, uint32_t *bitmap) ...@@ -118,7 +118,9 @@ static __be32 decode_bitmap(struct xdr_stream *xdr, uint32_t *bitmap)
if (likely(attrlen > 0)) if (likely(attrlen > 0))
bitmap[0] = ntohl(*p++); bitmap[0] = ntohl(*p++);
if (attrlen > 1) if (attrlen > 1)
bitmap[1] = ntohl(*p); bitmap[1] = ntohl(*p++);
if (attrlen > 2)
bitmap[2] = ntohl(*p);
return 0; return 0;
} }
...@@ -446,7 +448,7 @@ static __be32 decode_recallany_args(struct svc_rqst *rqstp, ...@@ -446,7 +448,7 @@ static __be32 decode_recallany_args(struct svc_rqst *rqstp,
void *argp) void *argp)
{ {
struct cb_recallanyargs *args = argp; struct cb_recallanyargs *args = argp;
uint32_t bitmap[2]; uint32_t bitmap[3];
__be32 *p, status; __be32 *p, status;
p = xdr_inline_decode(xdr, 4); p = xdr_inline_decode(xdr, 4);
......
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