NFSv4.2: Set the correct size scratch buffer for decoding READ_PLUS

[ Upstream commit 36357fe74e ]

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: d3b00a802c ("NFS: Replace the READ_PLUS decoding code")
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Anna Schumaker 2022-11-30 13:15:25 -05:00 committed by Greg Kroah-Hartman
parent 05acc401bc
commit f6a174755c
1 changed files with 1 additions and 1 deletions

View File

@ -1142,7 +1142,7 @@ static int decode_read_plus(struct xdr_stream *xdr, struct nfs_pgio_res *res)
if (!segs) if (!segs)
return -ENOMEM; return -ENOMEM;
xdr_set_scratch_buffer(xdr, &scratch_buf, 32); xdr_set_scratch_buffer(xdr, &scratch_buf, sizeof(scratch_buf));
status = -EIO; status = -EIO;
for (i = 0; i < segments; i++) { for (i = 0; i < segments; i++) {
status = decode_read_plus_segment(xdr, &segs[i]); status = decode_read_plus_segment(xdr, &segs[i]);