Re: [PATCH] NFSD: dst server needs to unmount src server's export after copy is done.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> On Mar 2, 2021, at 2:48 PM, Dai Ngo <dai.ngo@xxxxxxxxxx> wrote:
> 
> 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>

I haven't seen any negative comments on this patch, so I've added it
to the for-rc topic branch at

git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git


> ---
> 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, &copy->c_fh,
> 					      &copy->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
> 

--
Chuck Lever







[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux