From patchwork Mon Jan 13 21:54:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weston Andros Adamson X-Patchwork-Id: 3481001 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0A7EB9F169 for ; Mon, 13 Jan 2014 21:55:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E9F8320165 for ; Mon, 13 Jan 2014 21:55:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E1D7D2015E for ; Mon, 13 Jan 2014 21:55:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751947AbaAMVzE (ORCPT ); Mon, 13 Jan 2014 16:55:04 -0500 Received: from mail-ig0-f173.google.com ([209.85.213.173]:56035 "EHLO mail-ig0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751437AbaAMVzD (ORCPT ); Mon, 13 Jan 2014 16:55:03 -0500 Received: by mail-ig0-f173.google.com with SMTP id c10so3199493igq.0 for ; Mon, 13 Jan 2014 13:55:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=yzwNFwW46cyTSwgyKy8i1D6NZdKAvDq/NhbV+Z/IeEI=; b=Euo3URJMecN2rgA1bHvllEjz1DoyjZLnWFK8B9YjLJZZXvf6OuEGivMVzCIp5kxWZ8 15RrhSP/l1eGR0rP6uMSYjXRNwcmaUY9gbyqcGcGjuPfGE0WtBLHC9mqGOOTW4/L+/E5 l9eEl6jrQAKPguR6cC1tYjdWWUGFumW3F9yBBPb9rFBAnX4YZGvzcQ4lgtdWk+/RstxE cf8XVdkU+748/siwiC0FL6ugV0PudoyLNa1tNPchxBT3edcx4tJ2Oqwnxr/ijfn24myL r5TdoHeRIu6P55ZKZCw7dyCRIPIS4ani6Jfk4hSadmwHfc6Mpbfr143gSRt96WewBiDP lnMg== X-Gm-Message-State: ALoCoQlSPKKOLkP2mnPxr7mq6hvFvEPxGRIvmln4XUmQlPGW/0A7UCEnTTUmJhyjhozmtvoXTN0y X-Received: by 10.43.60.139 with SMTP id ws11mr23294909icb.12.1389650102501; Mon, 13 Jan 2014 13:55:02 -0800 (PST) Received: from localhost.localdomain (c-68-32-80-121.hsd1.mi.comcast.net. [68.32.80.121]) by mx.google.com with ESMTPSA id kt2sm21569488igb.1.2014.01.13.13.55.00 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 13 Jan 2014 13:55:01 -0800 (PST) From: Weston Andros Adamson To: trond.myklebust@primarydata.com Cc: linux-nfs@vger.kernel.org, Weston Andros Adamson Subject: [PATCH] nfs4.1: properly handle ENOTSUP in SECINFO_NO_NAME Date: Mon, 13 Jan 2014 16:54:45 -0500 Message-Id: <1389650085-4128-1-git-send-email-dros@primarydata.com> X-Mailer: git-send-email 1.8.3.4 (Apple Git-47) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Don't check for -NFS4ERR_NOTSUPP, it's already been mapped to -ENOTSUPP by nfs4_stat_to_errno. This allows the client to mount v4.1 servers that don't support SECINFO_NO_NAME by falling back to the "guess and check" method of nfs4_find_root_sec. Signed-off-by: Weston Andros Adamson --- I found this trying to mount a pynfs filelayout server. fs/nfs/nfs4proc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 15052b8..1d57b6a 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -7920,7 +7920,7 @@ nfs41_proc_secinfo_no_name(struct nfs_server *server, struct nfs_fh *fhandle, switch (err) { case 0: case -NFS4ERR_WRONGSEC: - case -NFS4ERR_NOTSUPP: + case -ENOTSUPP: goto out; default: err = nfs4_handle_exception(server, err, &exception); @@ -7954,7 +7954,7 @@ nfs41_find_root_sec(struct nfs_server *server, struct nfs_fh *fhandle, * Fall back on "guess and check" method if * the server doesn't support SECINFO_NO_NAME */ - if (err == -NFS4ERR_WRONGSEC || err == -NFS4ERR_NOTSUPP) { + if (err == -NFS4ERR_WRONGSEC || err == -ENOTSUPP) { err = nfs4_find_root_sec(server, fhandle, info); goto out_freepage; }