From: Trond Myklebust <trondmy@hammerspace.com>
To: "anna@kernel.org" <anna@kernel.org>,
"tigran.mkrtchyan@desy.de" <tigran.mkrtchyan@desy.de>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] nfs4: don't map EACCESS and EPERM to EIO
Date: Thu, 8 Jun 2023 15:33:16 +0000 [thread overview]
Message-ID: <cfde2b7b2a7f24f2652ce0bb82727cb0b810c758.camel@hammerspace.com> (raw)
In-Reply-To: <20230608144933.412664-1-tigran.mkrtchyan@desy.de>
Hi Tigran,
On Thu, 2023-06-08 at 16:49 +0200, Tigran Mkrtchyan wrote:
> the nfs4_map_errors function converts NFS specific errors to userland
> errors. However, it ignores NFS4ERR_PERM and EPERM, which then get
> mapped to EIO.
>
> Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
> ---
> fs/nfs/nfs4proc.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> index d3665390c4cb..795205fe4f30 100644
> --- a/fs/nfs/nfs4proc.c
> +++ b/fs/nfs/nfs4proc.c
> @@ -171,12 +171,14 @@ static int nfs4_map_errors(int err)
> case -NFS4ERR_LAYOUTTRYLATER:
> case -NFS4ERR_RECALLCONFLICT:
> return -EREMOTEIO;
> + case -NFS4ERR_PERM:
> case -NFS4ERR_WRONGSEC:
> case -NFS4ERR_WRONG_CRED:
> return -EPERM;
> case -NFS4ERR_BADOWNER:
> case -NFS4ERR_BADNAME:
> return -EINVAL;
> + case -NFS4ERR_ACCESS:
> case -NFS4ERR_SHARE_DENIED:
> return -EACCES;
> case -NFS4ERR_MINOR_VERS_MISMATCH:
Hmm... Aren't both these cases covered by the exception at the top of
the function?
static int nfs4_map_errors(int err)
{
if (err >= -1000)
return err;
As I read it, that should mean that err = -NFS4ERR_ACCESS (= -13) and
err = -NFS4ERR_PERM (= -1) will get returned verbatim.
Are you seeing these NFS4ERR_ACCESS and NFS4ERR_PERM cases hitting the
default: dprintk() when you turn it on?
--
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com
next prev parent reply other threads:[~2023-06-08 15:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-08 14:49 [PATCH] nfs4: don't map EACCESS and EPERM to EIO Tigran Mkrtchyan
2023-06-08 15:33 ` Trond Myklebust [this message]
[not found] ` <AD6C85BF-50F9-42BB-83E8-16BCE03D3CF1@desy.de>
2023-06-08 17:53 ` Trond Myklebust
2023-06-09 13:30 ` Mkrtchyan, Tigran
2023-06-09 14:00 ` Benjamin Coddington
2023-06-13 8:27 ` Mkrtchyan, Tigran
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=cfde2b7b2a7f24f2652ce0bb82727cb0b810c758.camel@hammerspace.com \
--to=trondmy@hammerspace.com \
--cc=anna@kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=tigran.mkrtchyan@desy.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox