Skip to content

Commit

Permalink
NFSv4.2: Set the correct size scratch buffer for decoding READ_PLUS
Browse files Browse the repository at this point in the history
The scratch_buf array is 16 bytes, but I was passing 32 to the
xdr_set_scratch_buffer() function. Fix this by using sizeof(), which is
what I probably should have been doing this whole time.

Fixes: d3b00a8 ("NFS: Replace the READ_PLUS decoding code")
Signed-off-by: Anna Schumaker <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
  • Loading branch information
amschuma-ntap authored and Trond Myklebust committed Dec 6, 2022
1 parent 50fa355 commit 36357fe
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfs/nfs42xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,7 @@ static int decode_read_plus(struct xdr_stream *xdr, struct nfs_pgio_res *res)
if (!segs)
return -ENOMEM;

xdr_set_scratch_buffer(xdr, &scratch_buf, 32);
xdr_set_scratch_buffer(xdr, &scratch_buf, sizeof(scratch_buf));
status = -EIO;
for (i = 0; i < segments; i++) {
status = decode_read_plus_segment(xdr, &segs[i]);
Expand Down

0 comments on commit 36357fe

Please sign in to comment.