All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] NFSD: Fix error return code in nfsd4_interssc_connect()
@ 2021-06-03 13:51 Wei Yongjun
  2021-06-03 15:16 ` J. Bruce Fields
  2021-06-03 16:23 ` dai.ngo
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2021-06-03 13:51 UTC (permalink / raw)
  To: weiyongjun1, Dai Ngo, J. Bruce Fields, Chuck Lever
  Cc: linux-nfs, kernel-janitors, Hulk Robot

'status' has been overwritten to 0 after nfsd4_ssc_setup_dul(), this
cause 0 will be return in vfs_kern_mount() error case. Fix to return
nfserr_inval in this error case.

Fixes: f4e44b393389 ("NFSD: delay unmount source's export after inter-server copy completed.")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 fs/nfsd/nfs4proc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index 0bd71c6da81d..2bfb6c408dc6 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -1323,6 +1323,7 @@ nfsd4_interssc_connect(struct nl4_server *nss, struct svc_rqst *rqstp,
 	ss_mnt = vfs_kern_mount(type, SB_KERNMOUNT, dev_name, raw_data);
 	module_put(type->owner);
 	if (IS_ERR(ss_mnt)) {
+		status = nfserr_inval;
 		if (work)
 			nfsd4_ssc_cancel_dul_work(nn, work);
 		goto out_free_devname;


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] NFSD: Fix error return code in nfsd4_interssc_connect()
  2021-06-03 13:51 [PATCH -next] NFSD: Fix error return code in nfsd4_interssc_connect() Wei Yongjun
@ 2021-06-03 15:16 ` J. Bruce Fields
  2021-06-03 16:23 ` dai.ngo
  1 sibling, 0 replies; 3+ messages in thread
From: J. Bruce Fields @ 2021-06-03 15:16 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: Dai Ngo, Chuck Lever, linux-nfs, kernel-janitors, Hulk Robot

On Thu, Jun 03, 2021 at 01:51:45PM +0000, Wei Yongjun wrote:
> 'status' has been overwritten to 0 after nfsd4_ssc_setup_dul(), this
> cause 0 will be return in vfs_kern_mount() error case. Fix to return
> nfserr_inval in this error case.

Is nfserr_inval the correct error?

--b.

> 
> Fixes: f4e44b393389 ("NFSD: delay unmount source's export after inter-server copy completed.")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>  fs/nfsd/nfs4proc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index 0bd71c6da81d..2bfb6c408dc6 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -1323,6 +1323,7 @@ nfsd4_interssc_connect(struct nl4_server *nss, struct svc_rqst *rqstp,
>  	ss_mnt = vfs_kern_mount(type, SB_KERNMOUNT, dev_name, raw_data);
>  	module_put(type->owner);
>  	if (IS_ERR(ss_mnt)) {
> +		status = nfserr_inval;
>  		if (work)
>  			nfsd4_ssc_cancel_dul_work(nn, work);
>  		goto out_free_devname;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] NFSD: Fix error return code in nfsd4_interssc_connect()
  2021-06-03 13:51 [PATCH -next] NFSD: Fix error return code in nfsd4_interssc_connect() Wei Yongjun
  2021-06-03 15:16 ` J. Bruce Fields
@ 2021-06-03 16:23 ` dai.ngo
  1 sibling, 0 replies; 3+ messages in thread
From: dai.ngo @ 2021-06-03 16:23 UTC (permalink / raw)
  To: Wei Yongjun, J. Bruce Fields, Chuck Lever
  Cc: linux-nfs, kernel-janitors, Hulk Robot


On 6/3/21 6:51 AM, Wei Yongjun wrote:
> 'status' has been overwritten to 0 after nfsd4_ssc_setup_dul(), this
> cause 0 will be return in vfs_kern_mount() error case. Fix to return
> nfserr_inval in this error case.
>
> Fixes: f4e44b393389 ("NFSD: delay unmount source's export after inter-server copy completed.")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
>   fs/nfsd/nfs4proc.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index 0bd71c6da81d..2bfb6c408dc6 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -1323,6 +1323,7 @@ nfsd4_interssc_connect(struct nl4_server *nss, struct svc_rqst *rqstp,
>   	ss_mnt = vfs_kern_mount(type, SB_KERNMOUNT, dev_name, raw_data);
>   	module_put(type->owner);
>   	if (IS_ERR(ss_mnt)) {
> +		status = nfserr_inval;

I think the correct error code is nfserr_nodev.

-Dai

>   		if (work)
>   			nfsd4_ssc_cancel_dul_work(nn, work);
>   		goto out_free_devname;
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-06-03 16:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-03 13:51 [PATCH -next] NFSD: Fix error return code in nfsd4_interssc_connect() Wei Yongjun
2021-06-03 15:16 ` J. Bruce Fields
2021-06-03 16:23 ` dai.ngo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.