From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2CD1C33CB1 for ; Fri, 17 Jan 2020 15:32:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BEB98214AF for ; Fri, 17 Jan 2020 15:32:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729214AbgAQPcP convert rfc822-to-8bit (ORCPT ); Fri, 17 Jan 2020 10:32:15 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:43708 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726942AbgAQPcN (ORCPT ); Fri, 17 Jan 2020 10:32:13 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-192-DZDUZOR_OCKUlzu7mSXGRA-1; Fri, 17 Jan 2020 10:32:10 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6DACE100551D; Fri, 17 Jan 2020 15:32:09 +0000 (UTC) Received: from aion.usersys.redhat.com (ovpn-126-23.rdu2.redhat.com [10.10.126.23]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 47864675AF; Fri, 17 Jan 2020 15:32:09 +0000 (UTC) Received: by aion.usersys.redhat.com (Postfix, from userid 1000) id 80DC71A00A4; Fri, 17 Jan 2020 10:32:08 -0500 (EST) Date: Fri, 17 Jan 2020 10:32:08 -0500 From: Scott Mayhew To: Trond Myklebust Cc: "dhowells@redhat.com" , "krzk@kernel.org" , "linux-nfs@vger.kernel.org" , "anna.schumaker@netapp.com" , "linux-kernel@vger.kernel.org" , "arnd@arndb.de" , "viro@zeniv.linux.org.uk" Subject: Re: [BISECT BUG] NFS v4 root not working after 6d972518b821 ("NFS: Add fs_context support.") Message-ID: <20200117153208.GB3111@aion.usersys.redhat.com> References: <20200117144055.GB3215@pi3> <433863.1579270803@warthog.procyon.org.uk> <461540.1579273958@warthog.procyon.org.uk> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-MC-Unique: DZDUZOR_OCKUlzu7mSXGRA-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aion.usersys.redhat.com Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: 8BIT Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 17 Jan 2020, Trond Myklebust wrote: > On Fri, 2020-01-17 at 15:12 +0000, David Howells wrote: > > Krzysztof Kozlowski wrote: > > > > > mount.nfs4 -o vers=4,nolock 192.168.1.10:/srv/nfs/odroidhc1 > > > /new_root > > > > Okay, it looks like the mount command makes two attempts at mounting. > > Firstly, it does this: > > > > > [ 22.938314] NFSOP 'source=192.168.1.10:/srv/nfs/odroidhc1' > > > [ 22.942638] NFSOP 'nolock=(null)' > > > [ 22.945772] NFSOP 'vers=4.2' > > > [ 22.948660] NFSOP 'addr=192.168.1.10' > > > [ 22.952350] NFSOP 'clientaddr=192.168.1.12' > > > [ 22.956831] NFS4: Couldn't follow remote path > > > > Which accepts the "vers=4.2" parameter as there's no check that that > > is > > actually valid given the configuration, but then fails > > later. Secondly, it > > does this: > > > > > [ 22.971001] NFSOP 'source=192.168.1.10:/srv/nfs/odroidhc1' > > > [ 22.975217] NFSOP 'nolock=(null)' > > > [ 22.978444] NFSOP 'vers=4' > > > [ 22.981265] NFSOP 'minorversion=1' > > > [ 22.984513] NFS: Value for 'minorversion' out of range > > > mount.nfs4: Numerical result out of range > > > > which fails because of the minorversion=1 specification, where the > > kernel > > config didn't enable NFS_V4_1. > > > > It looks like it ought to have failed prior to these patches in the > > same way: > > > > case Opt_minorversion: > > if (nfs_get_option_ul(args, &option)) > > goto out_invalid_value; > > if (option > NFS4_MAX_MINOR_VERSION) > > goto out_invalid_value; > > mnt->minorversion = option; > > break; > > > > It looks like someone changed the return value from the old EINVAL to > something else? The "Numerical result out of range" message above > suggests it has been changed to EOVERFLOW, which probably is not > supported by 'mount'. It's returning ERANGE... and nope, mount.nfs doesn't support it (see nfs_autonegotiate() in utils/mount/stropts.c). Changing it to return EINVAL fixes it: 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); } /* I think I may have been running a hacked up version of mount.nfs before... because as soon as I updated my nfs-utils package it stopped working for me too. -Scott > > -- > Trond Myklebust > Linux NFS client maintainer, Hammerspace > trond.myklebust@hammerspace.com > >