From patchwork Wed Dec 17 18:47:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Adamson X-Patchwork-Id: 5508731 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 99A459F1D4 for ; Wed, 17 Dec 2014 18:47:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D1793209D5 for ; Wed, 17 Dec 2014 18:47:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F025F209D3 for ; Wed, 17 Dec 2014 18:47:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750790AbaLQSrf (ORCPT ); Wed, 17 Dec 2014 13:47:35 -0500 Received: from mx1.netapp.com ([216.240.18.38]:15030 "EHLO mx1.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751428AbaLQSrc (ORCPT ); Wed, 17 Dec 2014 13:47:32 -0500 X-IronPort-AV: E=Sophos;i="5.07,595,1413270000"; d="scan'208";a="357359744" Received: from vmwexchts04-prd.hq.netapp.com ([10.122.105.32]) by mx1-out.netapp.com with ESMTP; 17 Dec 2014 10:47:32 -0800 Received: from smtp1.corp.netapp.com (10.57.156.124) by VMWEXCHTS04-PRD.hq.netapp.com (10.122.105.32) with Microsoft SMTP Server id 15.0.995.29; Wed, 17 Dec 2014 10:47:31 -0800 Received: from rhel7-ga.androsad.fake (vpn2ntap-488830.vpn.netapp.com [10.55.73.12]) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id sBHIlTcp021737; Wed, 17 Dec 2014 10:47:30 -0800 (PST) From: To: CC: , Andy Adamson Subject: [PATCH 1/1] NFS: try RPC_AUTH_GSS_KRB5 after RPC_AUTH_GSS_KRB5I for cl_rpcclient Date: Wed, 17 Dec 2014 13:47:23 -0500 Message-ID: <1418842043-15074-2-git-send-email-andros@netapp.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1418842043-15074-1-git-send-email-andros@netapp.com> References: <1418842043-15074-1-git-send-email-andros@netapp.com> 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=unavailable 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 From: Andy Adamson Some servers implement KRB5 but not KRB5I. With out this patch, said servers will use AUTH_UNIX for state creation, even when exporting a volume with krb5. Signed-off-by: Andy Adamson --- fs/nfs/nfs4state.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 5194933..a56ad3f 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c @@ -2063,6 +2063,21 @@ again: nfs4_root_machine_cred(clp); goto again; } + if (clnt->cl_auth->au_flavor == RPC_AUTH_GSS_KRB5I) { + clnt = rpc_clone_client_set_auth(clnt, RPC_AUTH_GSS_KRB5); + if (IS_ERR(clnt)) { + status = PTR_ERR(clnt); + break; + } + /* Note: this is safe because we haven't yet marked the + * client as ready, so we are the only user of + * clp->cl_rpcclient + */ + clnt = xchg(&clp->cl_rpcclient, clnt); + rpc_shutdown_client(clnt); + clnt = clp->cl_rpcclient; + goto again; + } if (clnt->cl_auth->au_flavor == RPC_AUTH_UNIX) break; case -NFS4ERR_CLID_INUSE: