Commit 614c9750 authored by Olga Kornievskaia's avatar Olga Kornievskaia Committed by Chuck Lever
Browse files

NFSD: fix dest to src mount in inter-server COPY



A cleanup of the inter SSC copy needs to call fput() of the source
file handle to make sure that file structure is freed as well as
drop the reference on the superblock to unmount the source server.

Fixes: 36e1e5ba ("NFSD: Fix use-after-free warning when doing inter-server copy")
Signed-off-by: default avatarOlga Kornievskaia <kolga@netapp.com>
Signed-off-by: default avatarChuck Lever <chuck.lever@oracle.com>
Tested-by: default avatarDai Ngo <dai.ngo@oracle.com>
parent 6ee65a77
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1302,7 +1302,7 @@ nfsd4_cleanup_inter_ssc(struct vfsmount *ss_mnt, struct nfsd_file *src,
			struct nfsd_file *dst)
{
	nfs42_ssc_close(src->nf_file);
	/* 'src' is freed by nfsd4_do_async_copy */
	fput(src->nf_file);
	nfsd_file_put(dst);
	mntput(ss_mnt);
}