Currently the destination server leaves the source server's export intact on the destination after copy is done. This patch fixes this by doing ssc disconnect from nfsd4_do_async_copy after copy is done. Signed-off-by: Dai Ngo <dai.ngo@xxxxxxxxxx> --- fs/nfsd/nfs4proc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 8d6d2678abad..d3d864b8ee4f 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c @@ -1306,7 +1306,6 @@ nfsd4_cleanup_inter_ssc(struct vfsmount *ss_mnt, struct nfsd_file *src, nfs42_ssc_close(src->nf_file); /* 'src' is freed by nfsd4_do_async_copy */ nfsd_file_put(dst); - mntput(ss_mnt); } #else /* CONFIG_NFSD_V4_2_INTER_SSC */ @@ -1472,14 +1471,12 @@ static int nfsd4_do_async_copy(void *data) copy->nf_src = kzalloc(sizeof(struct nfsd_file), GFP_KERNEL); if (!copy->nf_src) { copy->nfserr = nfserr_serverfault; - nfsd4_interssc_disconnect(copy->ss_mnt); goto do_callback; } copy->nf_src->nf_file = nfs42_ssc_open(copy->ss_mnt, ©->c_fh, ©->stateid); if (IS_ERR(copy->nf_src->nf_file)) { copy->nfserr = nfserr_offload_denied; - nfsd4_interssc_disconnect(copy->ss_mnt); goto do_callback; } } @@ -1498,8 +1495,10 @@ static int nfsd4_do_async_copy(void *data) &nfsd4_cb_offload_ops, NFSPROC4_CLNT_CB_OFFLOAD); nfsd4_run_cb(&cb_copy->cp_cb); out: - if (!copy->cp_intra) + if (!copy->cp_intra) { + nfsd4_interssc_disconnect(copy->ss_mnt); kfree(copy->nf_src); + } cleanup_async_copy(copy); return 0; } -- 2.9.5