From: Krzysztof Kozlowski <krzk@kernel.org>
To: David Howells <dhowells@redhat.com>
Cc: Trond Myklebust <trond.myklebust@hammerspace.com>,
Anna Schumaker <anna.schumaker@netapp.com>,
linux-nfs@vger.kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>,
Scott Mayhew <smayhew@redhat.com>, Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v2] nfs: Return EINVAL rather than ERANGE for mount parse errors
Date: Fri, 17 Jan 2020 17:51:33 +0100 [thread overview]
Message-ID: <20200117165133.GA5762@pi3> (raw)
In-Reply-To: <465149.1579276509@warthog.procyon.org.uk>
On Fri, Jan 17, 2020 at 03:55:09PM +0000, David Howells wrote:
> commit b9423c912b770e5b9e4228d90da92b6a69693d8e
> Author: David Howells <dhowells@redhat.com>
> Date: Fri Jan 17 15:37:46 2020 +0000
>
> nfs: Return EINVAL rather than ERANGE for mount parse errors
>
> Return EINVAL rather than ERANGE for mount parse errors as the userspace
> mount command doesn't necessarily understand what to do with anything other
> than EINVAL.
>
> The old code returned -ERANGE as an intermediate error that then get
> converted to -EINVAL, whereas the new code returns -ERANGE.
>
> This was induced by passing minorversion=1 to a v4 mount where
> CONFIG_NFS_V4_1 was disabled in the kernel build.
>
> Fixes: 68f65ef40e1e ("NFS: Convert mount option parsing to use functionality from fs_parser.h")
> Reported-by: Krzysztof Kozlowski <krzk@kernel.org>
> Signed-off-by: David Howells <dhowells@redhat.com>
>
> diff --git a/fs/nfs/fs_context.c b/fs/nfs/fs_context.c
> index 429315c011ae..74508ed9aeec 100644
> --- a/fs/nfs/fs_context.c
> +++ b/fs/nfs/fs_context.c
> @@ -769,8 +769,7 @@ static int nfs_fs_context_parse_param(struct fs_context *fc,
> out_invalid_address:
> return nfs_invalf(fc, "NFS: Bad IP address specified");
> out_of_bounds:
> - nfs_invalf(fc, "NFS: Value for '%s' out of range", param->key);
> - return -ERANGE;
> + return nfs_invalf(fc, "NFS: Value for '%s' out of range", param->key);
> }
>
> /*
Yes, the boards boots up, thanks!
Tested-by: Krzysztof Kozlowski <krzk@kernel.org>
I did not run extensive tests but few boots show also 2-3 seconds faster
mount of NFS root (faster switch from initramfs to proper user-space
from NFS).
Best regards,
Krzysztof
next prev parent reply other threads:[~2020-01-17 16:51 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-16 11:33 [BISECT BUG] NFS v4 root not working after 6d972518b821 ("NFS: Add fs_context support.") Krzysztof Kozlowski
2020-01-17 0:49 ` Scott Mayhew
2020-01-17 11:53 ` Krzysztof Kozlowski
2020-01-17 12:54 ` David Howells
2020-01-17 13:16 ` Krzysztof Kozlowski
2020-01-17 14:08 ` David Howells
2020-01-17 14:36 ` Krzysztof Kozlowski
2020-01-17 14:20 ` David Howells
2020-01-17 14:40 ` Krzysztof Kozlowski
2020-01-17 15:12 ` David Howells
2020-01-17 15:17 ` Trond Myklebust
2020-01-17 15:32 ` Scott Mayhew
2020-01-17 15:44 ` David Howells
2020-01-17 15:48 ` [PATCH] nfs: Return EINVAL rather than ERANGE for mount parse errors David Howells
2020-01-17 15:55 ` [PATCH v2] " David Howells
2020-01-17 16:51 ` Krzysztof Kozlowski [this message]
2020-01-17 17:18 ` David Howells
2020-01-17 20:21 ` Schumaker, Anna
2020-01-17 21:12 ` David Howells
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=20200117165133.GA5762@pi3 \
--to=krzk@kernel.org \
--cc=anna.schumaker@netapp.com \
--cc=arnd@arndb.de \
--cc=dhowells@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=smayhew@redhat.com \
--cc=trond.myklebust@hammerspace.com \
--cc=viro@zeniv.linux.org.uk \
/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