]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
nfsd: change nfs4_client_to_reclaim() to allocate data
authorNeilBrown <neil@brown.name>
Mon, 8 Sep 2025 01:38:33 +0000 (11:38 +1000)
committerChuck Lever <chuck.lever@oracle.com>
Sun, 16 Nov 2025 23:20:11 +0000 (18:20 -0500)
commit4552f4e3f2c96597914f07b060d5c5db84420ddd
tree3312acfa3da3db87451a9c8ede90145191e0abe4
parent89bd77cf436bf25e448817a662ebf76515f22863
nfsd: change nfs4_client_to_reclaim() to allocate data

The calling convention for nfs4_client_to_reclaim() is clumsy in that
the caller needs to free memory if the function fails.  It is much
cleaner if the function frees its own memory.

This patch changes nfs4_client_to_reclaim() to re-allocate the .data
fields to be stored in the newly allocated struct nfs4_client_reclaim,
and to free everything on failure.

__cld_pipe_inprogress_downcall() needs to allocate the data anyway to
copy it from user-space, so now that data is allocated twice.  I think
that is a small price to pay for a cleaner interface.

Signed-off-by: NeilBrown <neil@brown.name>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4recover.c
fs/nfsd/nfs4state.c