NFSv4.2: Rework scratch handling for READ_PLUS
authorAnna Schumaker <Anna.Schumaker@Netapp.com>
Thu, 6 Apr 2023 19:16:52 +0000 (15:16 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Sep 2023 07:42:48 +0000 (09:42 +0200)
commit886959f425b6a936a30b82a297ae3aecb3b8230f
tree876c42b78be17132f108e2072f9a773cabc1cb3c
parente12e13952b0c38acde74c27cc1ccf5c0321dcc4f
NFSv4.2: Rework scratch handling for READ_PLUS

[ Upstream commit fbd2a05f29a95d5b42b294bf47e55a711424965b ]

Instead of using a tiny, static scratch buffer, we should use a kmalloc()-ed
buffer that is allocated when checking for read plus usage. This lets us
use the buffer before decoding any part of the READ_PLUS operation
instead of setting it right before segment decoding, meaning it should
be a little more robust.

Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Stable-dep-of: bb05a617f06b ("NFSv4.2: Fix READ_PLUS smatch warnings")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/nfs42xdr.c
fs/nfs/nfs4proc.c
include/linux/nfs_xdr.h