Skip to content

Commit 9583299

Browse files
jtlaytonamschuma-ntap
authored andcommitted
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: 43df711 ("NFSv4: Add CB_GETATTR support for delegated attributes") Signed-off-by: Jeff Layton <[email protected]> Reviewed-by: Benjamin Coddington <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent cb78f9b commit 9583299

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/nfs/callback_xdr.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,9 @@ static __be32 decode_bitmap(struct xdr_stream *xdr, uint32_t *bitmap)
118118
if (likely(attrlen > 0))
119119
bitmap[0] = ntohl(*p++);
120120
if (attrlen > 1)
121-
bitmap[1] = ntohl(*p);
121+
bitmap[1] = ntohl(*p++);
122+
if (attrlen > 2)
123+
bitmap[2] = ntohl(*p);
122124
return 0;
123125
}
124126

@@ -446,7 +448,7 @@ static __be32 decode_recallany_args(struct svc_rqst *rqstp,
446448
void *argp)
447449
{
448450
struct cb_recallanyargs *args = argp;
449-
uint32_t bitmap[2];
451+
uint32_t bitmap[3];
450452
__be32 *p, status;
451453

452454
p = xdr_inline_decode(xdr, 4);

0 commit comments

Comments
 (0)