Skip to content
Commit 81e72297 authored by Dai Ngo's avatar Dai Ngo Committed by Chuck Lever
Browse files

NFSD: fix problems with cleanup on errors in nfsd4_copy



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>
parent fb610c4d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment