Skip to content

Commit 36357fe

Browse files
amschuma-ntapTrond Myklebust
authored andcommitted
NFSv4.2: Set the correct size scratch buffer for decoding READ_PLUS
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]>
1 parent 50fa355 commit 36357fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/nfs/nfs42xdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ static int decode_read_plus(struct xdr_stream *xdr, struct nfs_pgio_res *res)
11421142
if (!segs)
11431143
return -ENOMEM;
11441144

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

0 commit comments

Comments
 (0)