Commit 3db6c79d authored by Dai Ngo's avatar Dai Ngo Committed by Greg Kroah-Hartman
Browse files

NFSD: fix problems with cleanup on errors in nfsd4_copy



[ Upstream commit 81e72297 ]

When nfsd4_copy fails to allocate memory for async_copy->cp_src, or
nfs4_init_copy_state fails, it calls cleanup_async_copy to do the
cleanup for the async_copy which causes page fault since async_copy
is not yet initialized.

This patche rearranges the order of initializing the fields in
async_copy and adds checks in cleanup_async_copy to skip un-initialized
fields.

Fixes: ce0887ac ("NFSD add nfs4 inter ssc to nfsd4_copy")
Fixes: 87689df6 ("NFSD: Shrink size of struct nfsd4_copy")
Signed-off-by: default avatarDai Ngo <dai.ngo@oracle.com>
Reviewed-by: default avatarJeff Layton <jlayton@kernel.org>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent e5e1dc82
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment