From patchwork Thu Dec 17 01:56:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: NeilBrown X-Patchwork-Id: 7868371 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 46233BEEE5 for ; Thu, 17 Dec 2015 01:58:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 70FDC203E3 for ; Thu, 17 Dec 2015 01:58:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8CE97203C0 for ; Thu, 17 Dec 2015 01:58:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755736AbbLQB6a (ORCPT ); Wed, 16 Dec 2015 20:58:30 -0500 Received: from mx2.suse.de ([195.135.220.15]:56818 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754562AbbLQB6a (ORCPT ); Wed, 16 Dec 2015 20:58:30 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 5F6E7AB12; Thu, 17 Dec 2015 01:58:29 +0000 (UTC) From: NeilBrown To: Steve Dickson Date: Thu, 17 Dec 2015 12:56:34 +1100 Subject: [PATCH 2/2] Fix protocol minor version fall-back Cc: linux-nfs@vger.kernel.org, Takashi Iwai Message-ID: <20151217015634.19978.65001.stgit@noble> In-Reply-To: <20151217015524.19978.63114.stgit@noble> References: <20151217015524.19978.63114.stgit@noble> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP mount.nfs currently expects mount(2) to fail with EPROTONOSUPPORT if the kernel doesn't understand the requested NFS version. Unfortunately if the requested minor is not known to the kernel it returns -EINVAL. In kernels since 3.11 this can happen in nfs4_alloc_client(), if compiled without NFS_V4_2. More generally it can happen in in nfs_validate_text_mount_data() when nfs_parse_mount_options() returns 0 because nfs_parse_version_string() didn't recognise the version. EPROTONOSUPPORT is only returned if NFSv4 support is completely compiled out. So nfs_autonegotiate needs to check for EINVAL as well as EPROTONOSUPPORT. URL: https://bugzilla.opensuse.org/show_bug.cgi?id=959211 Reported-by: Takashi Iwai Signed-off-by: NeilBrown --- utils/mount/stropts.c | 3 +++ 1 file changed, 3 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c index c8f5a6d223e7..86829a902bfd 100644 --- a/utils/mount/stropts.c +++ b/utils/mount/stropts.c @@ -841,6 +841,9 @@ check_result: case EPROTONOSUPPORT: /* A clear indication that the server or our * client does not support NFS version 4 and minor */ + case EINVAL: + /* A less clear indication that our client + * does not support NFSv4 minor version. */ if (mi->version.v_mode == V_GENERAL && mi->version.minor == 0) return result;