From: "J. Bruce Fields" <bfields@fieldses.org>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: Chuck Lever <chuck.lever@oracle.com>,
Dai Ngo <dai.ngo@oracle.com>,
linux-nfs@vger.kernel.org, kernel-janitors@vger.kernel.org,
Hulk Robot <hulkci@huawei.com>
Subject: Re: [PATCH -next v2] NFSD: Fix error return code in nfsd4_interssc_connect()
Date: Fri, 4 Jun 2021 10:40:19 -0400 [thread overview]
Message-ID: <20210604144019.GC24620@fieldses.org> (raw)
In-Reply-To: <20210604101237.1661615-1-weiyongjun1@huawei.com>
On Fri, Jun 04, 2021 at 10:12:37AM +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_nodev in this error.
Why is that the right error? I don't see it mentioned among the errors
COPY can return:
https://datatracker.ietf.org/doc/html/rfc7862#page-50
It might be reasonable to just map the error returned by vfs_kern_mount
to an nfs error, I don't know--we'd need to think about the different
errors vfs_kern_mount might return.
OFFLOAD_DENIED seems safe as it should cause a fallback to a normal
copy.
Same goes for the other spot here where we return nodev.
--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>
> ---
> v1 -> v2: change to return nfserr_nodev
> ---
> fs/nfsd/nfs4proc.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index 0bd71c6da81d..b082cbde3e07 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_nodev;
> if (work)
> nfsd4_ssc_cancel_dul_work(nn, work);
> goto out_free_devname;
next prev parent reply other threads:[~2021-06-04 14:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-04 10:12 [PATCH -next v2] NFSD: Fix error return code in nfsd4_interssc_connect() Wei Yongjun
2021-06-04 14:40 ` J. Bruce Fields [this message]
2021-06-04 16:36 ` dai.ngo
2021-06-04 17:30 ` J. Bruce Fields
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210604144019.GC24620@fieldses.org \
--to=bfields@fieldses.org \
--cc=chuck.lever@oracle.com \
--cc=dai.ngo@oracle.com \
--cc=hulkci@huawei.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=weiyongjun1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.