Skip to content

Commit

Permalink
NFSD: fix dest to src mount in inter-server COPY
Browse files Browse the repository at this point in the history
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: 36e1e5b ("NFSD: Fix use-after-free warning when doing inter-server copy")
Signed-off-by: Olga Kornievskaia <[email protected]>
Signed-off-by: Chuck Lever <[email protected]>
Tested-by: Dai Ngo <[email protected]>
  • Loading branch information
olgakorn1 authored and chucklever committed Mar 9, 2021
1 parent 6ee65a7 commit 614c975
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/nfsd/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 614c975

Please sign in to comment.