Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9192353ybl; Fri, 17 Jan 2020 07:48:44 -0800 (PST) X-Google-Smtp-Source: APXvYqznlmCkaW6yMmfaPcZnwJwkeNxWnhX5gQUJyekfBMeM4a0dbA7VAt1MJ81Wk27voaJjQOmc X-Received: by 2002:aca:59c2:: with SMTP id n185mr3927084oib.170.1579276124773; Fri, 17 Jan 2020 07:48:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579276124; cv=none; d=google.com; s=arc-20160816; b=xOBSy6BULvn5w9aiBoDyGNH5YYsd5GJEXgx3og8uLK11khPDp8igaDHvMFkjmfKCmr Sk+IWiB4VkhZPpBmMx/b+ZTPQSmkmD0qrKIh7r1XRYHwXgX1oGfrAM0mk2eLzo3psgdr qg/3RzcjCWZTS0TGTSOBAPJTC6XoQsworuhwJBYSdc8GPpF/jhCHt3TVnNR6Z82x4KgN LO4hOLoZ62681072bpPoVivVMxMEH8Xwdia0DkHspfdj+bcC49It2nQ2qmTDTX8hvLru f4US/Fuaw4pJpFCkjOV/s0DciE1EiXLea3K7MRbsCWR0PV6vzYLVhV1R2eFz2Lr8x1hA L7Kg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:content-transfer-encoding :content-id:mime-version:subject:cc:to:references:in-reply-to:from :organization:dkim-signature; bh=LdBL2slNDE/rtW+Xz9P92Zb9qLwhk6nZyC6cAzxgr5o=; b=gDBH8bYhd6rqJ7upIB6ZQ73FucupFSFZtw1cmAXy9PYkBsdEJF7rAySvkCy41ZUgP/ fG2EcpIgNQ0fT35/F+1KxCVvY63NCC5d8amz29XlapT8b0I4N9hoyUoh+axVzslXcVdb 7hE53OOCeWbeU4GYfIF9c/9FG45GSe0A1o1ZRe4+EQNeOSUsK123AbIYiEJmnjCGVzRz maV/8pJadepsRhtU88qKKbUy6oLiminj7vAiHSnJ5lhKT8pPuCPJJsV88Owgms14vTvR i4owWxBtg59VEdCM8YKBX1feaSPOGBX4OUy075mNbUyotmZVN9p5pioXjvbkFBEGMRay 6dHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Y8YR04hg; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i5si13945379oif.211.2020.01.17.07.48.33; Fri, 17 Jan 2020 07:48:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Y8YR04hg; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728780AbgAQPsb (ORCPT + 99 others); Fri, 17 Jan 2020 10:48:31 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:26876 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727043AbgAQPsb (ORCPT ); Fri, 17 Jan 2020 10:48:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579276110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LdBL2slNDE/rtW+Xz9P92Zb9qLwhk6nZyC6cAzxgr5o=; b=Y8YR04hg2FUmh0mqjYstEsAciQoVoVmuL0MACefVXKxFdte8A56zf75Ji+5sXeSUR9hOVx km3YwX0iQ6fl+hOGMwHuLcWj3ay8gau+elEU/pZR0vlgwG6P6sMO+MIx1oTwzh3eQjLP9Y NAB9ywFxlKY9Bd6k5qFSo1C9vjd9xro= 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-411-IabzsO5JOFearTadoPmb8Q-1; Fri, 17 Jan 2020 10:48:27 -0500 X-MC-Unique: IabzsO5JOFearTadoPmb8Q-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 37B94107BAAB; Fri, 17 Jan 2020 15:48:26 +0000 (UTC) Received: from warthog.procyon.org.uk (ovpn-120-49.rdu2.redhat.com [10.10.120.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0AFC3101F942; Fri, 17 Jan 2020 15:48:23 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20200117144055.GB3215@pi3> References: <20200117144055.GB3215@pi3> <433863.1579270803@warthog.procyon.org.uk> To: Krzysztof Kozlowski Cc: dhowells@redhat.com, Trond Myklebust , Anna Schumaker , linux-nfs@vger.kernel.org, "linux-kernel@vger.kernel.org" , Al Viro , Scott Mayhew , Arnd Bergmann Subject: [PATCH] nfs: Return EINVAL rather than ERANGE for mount parse errors MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <464518.1579276102.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Fri, 17 Jan 2020 15:48:22 +0000 Message-ID: <464519.1579276102@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi Krzysztof, Does this patch fix the problem? David --- commit 3021f58ee1e2c9659e629d0ccf06d3e0876e805a Author: David Howells 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 userspa= ce 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=3D1 to a v4 mount where CONFIG_NFS_V4_1 was disabled in the kernel build. = Fixes: 68f65ef40e1e ("NFS: Convert mount option parsing to use functio= nality from fs_parser.h") Reported-by: Krzysztof Kozlowski Signed-off-by: David Howells diff --git a/fs/nfs/fs_context.c b/fs/nfs/fs_context.c index 429315c011ae..07cbd655dafb 100644 --- a/fs/nfs/fs_context.c +++ b/fs/nfs/fs_context.c @@ -770,7 +770,7 @@ static int nfs_fs_context_parse_param(struct fs_contex= t *fc, 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 -EINVAL; } = /*