From patchwork Thu Nov 14 12:25:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 3182261 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 CE9B49F432 for ; Thu, 14 Nov 2013 12:25:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 089B12095A for ; Thu, 14 Nov 2013 12:25:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D4E412095B for ; Thu, 14 Nov 2013 12:25:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753410Ab3KNMZc (ORCPT ); Thu, 14 Nov 2013 07:25:32 -0500 Received: from mail-qa0-f53.google.com ([209.85.216.53]:58034 "EHLO mail-qa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753194Ab3KNMZb (ORCPT ); Thu, 14 Nov 2013 07:25:31 -0500 Received: by mail-qa0-f53.google.com with SMTP id k4so1295892qaq.12 for ; Thu, 14 Nov 2013 04:25:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=+/jtQMVLLy9aQ1f31CcuQKcTe7xUJ3OUpsif3bTNZPc=; b=iKNXIsgWvPqHXuRP1G2Mcx96FQwJSqDGCm6rf6IDA1OFGfLtN/6yt8XFMeapnZGSNo Vsp2+7BCM/Ts3PYY7fv3XCO/A/mSi1SHi33sBqWPykma5Bl84iA+1MAROiQHkf8oq6B1 twNNNeoVVkPVUT/SOhZpZ0+ykbPiuH6JuagJWCiN0oWOPUu1npThK1eme2LNhB6P2+3+ Y9UaT2qCrBTfTny8kdk0gfncp/BwP0830BPHzpnJ9NdzPW019eeqIZtpWPDGygvQBL2n bqCh5kcrBYubrw8YRNx0Qvlv2L8boW8RhzxT9dmjtrLjr0Xi+wFhF/c1/GsN968RkDZ7 CrdQ== X-Gm-Message-State: ALoCoQmgqgWnZf9iQ+mk68vT3f5bJ/SO6su0XKqsjIgDi9mJYECWc78/aEM1+3WZut1p+Vr44/+I X-Received: by 10.224.51.131 with SMTP id d3mr1902663qag.0.1384431930455; Thu, 14 Nov 2013 04:25:30 -0800 (PST) Received: from salusa.poochiereds.net (cpe-107-015-124-230.nc.res.rr.com. [107.15.124.230]) by mx.google.com with ESMTPSA id b9sm81267743qas.7.2013.11.14.04.25.29 for (version=TLSv1.2 cipher=AES128-GCM-SHA256 bits=128/128); Thu, 14 Nov 2013 04:25:29 -0800 (PST) From: Jeff Layton To: trond.myklebust@netapp.com Cc: chuck.lever@oracle.com, neilb@suse.de, steved@redhat.com, linux-nfs@vger.kernel.org Subject: [PATCH v4 3/3] nfs: check if gssd is running before attempting to use krb5i auth in SETCLIENTID call Date: Thu, 14 Nov 2013 07:25:19 -0500 Message-Id: <1384431919-20921-4-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1384431919-20921-1-git-send-email-jlayton@redhat.com> References: <1384431919-20921-1-git-send-email-jlayton@redhat.com> 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, 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 Currently, the client will attempt to use krb5i in the SETCLIENTID call even if rpc.gssd isn't running. When that fails, it'll then fall back to RPC_AUTH_UNIX. This introduced a delay when mounting if rpc.gssd isn't running, and causes warning messages to pop up in the ring buffer. Check to see if rpc.gssd is running before even attempting to use krb5i auth, and just silently skip trying to do so if it isn't. In the event that the admin is actually trying to mount with krb5*, it will still fail at a later stage of the mount attempt. Signed-off-by: Jeff Layton --- fs/nfs/nfs4client.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c index b4a160a..c1b7a80 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "internal.h" #include "callback.h" #include "delegation.h" @@ -370,7 +371,11 @@ struct nfs_client *nfs4_init_client(struct nfs_client *clp, __set_bit(NFS_CS_INFINITE_SLOTS, &clp->cl_flags); __set_bit(NFS_CS_DISCRTRY, &clp->cl_flags); __set_bit(NFS_CS_NO_RETRANS_TIMEOUT, &clp->cl_flags); - error = nfs_create_rpc_client(clp, timeparms, RPC_AUTH_GSS_KRB5I); + + error = -EINVAL; + if (gssd_running(clp->cl_net)) + error = nfs_create_rpc_client(clp, timeparms, + RPC_AUTH_GSS_KRB5I); if (error == -EINVAL) error = nfs_create_rpc_client(clp, timeparms, RPC_AUTH_UNIX); if (error < 0)