linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Jeff Layton <jlayton@redhat.com>
Cc: trond.myklebust@netapp.com, linux-nfs@vger.kernel.org,
	neilb@suse.de, chuck.lever@oracle.com, steved@redhat.com
Subject: Re: [PATCH v2 0/3] sunrpc/nfs: more reliable detection of running gssd
Date: Thu, 14 Nov 2013 14:26:01 -0500	[thread overview]
Message-ID: <20131114192601.GC21152@fieldses.org> (raw)
In-Reply-To: <1384353053-30002-1-git-send-email-jlayton@redhat.com>

On Wed, Nov 13, 2013 at 09:30:50AM -0500, Jeff Layton wrote:
> v2:
> - change name of toplevel pipefs dir from "dummy" to "gssd" (per
>   Trond's suggestion)
> 
> - when gssd isn't running, don't bother to upcall (per Neil B.'s
>   suggestion)
> 
> - fix lifecycle of rpc_pipe data. Previously it would have leaked
>   after umount. With this set, it's created and destroyed along with
>   the netns, and just attached to the pipe inode on mount/unmount
>   of rpc_pipefs.
> 
> - patch has been added to skip attempting setclientid with krb5i
>   if gssd isn't running. This avoids the "AUTH_GSS upcall timed out"
>   message when gssd isn't running and you mount with sec=sys. It also
>   shortens the delay when gssd isn't up.
> 
> The original cover letter from the v1 posting follows. Note that this
> set does address the warnings about the AUTH_GSS upcall timing out.
> 
> -------------------------[snip]-----------------------------
> 
> We've gotten a lot of complaints recently about the 15s delay when
> doing a sec=sys mount without gssd running.
> 
> A large part of the problem is that the kernel isn't able to reliably
> detect when rpc.gssd is running. What we currently have is a
> gssd_running flag that is initially set to 1. When an upcall times out,
> that gets set to 0, and subsequent upcalls get a much shorter timeout
> (1/4s instead of 15s). It's reset back to '1' when a pipe is reopened.
> 
> The approach of using a flag like this is pretty inadequate. First, it
> doesn't eliminate the long delay on the initial upcall attempt. Also,
> if gssd spontaneously dies, then the flag will still be set to 1 until
> the next upcall attempt times out. Finally, it currently requires that
> the pipe be reopened in order to reset the flag back to true.
> 
> This patchset replaces that flag with a more reliable mechanism for
> detecting when gssd is running. When rpc_pipefs is mounted, it creates a
> new "dummy" pipe that gssd will naturally find and hold open. We'll
> never send an upcall down this pipe, and writing to it always fails.
> But, since we can detect when something is holding it open, we can use
> that to determine whether gssd is running.

I think this might have been addressed before, I don't remember: does
the init system currently have a way to wait till gssd has gotten as far
as scanning pipefs before allowing mounts?

(To avoid the race where a krb5 mount fails because gssd is still in the
process of being started.)

--b.

> 
> The current patch just uses this mechanism to replace the gssd_running
> flag with this new mechanism. This shortens the long delay when mounting
> without gssd running, but does not silence these warnings:
> 
>     RPC: AUTH_GSS upcall timed out.
>     Please check user daemon is running.
> 
> I'm willing to add a patch to do that, but I'm a little unclear on the
> best way to do so. Those messages are generated by the auth_gss code. We
> probably do want to print them if someone mounted with sec=krb5, but
> suppress them when mounting with sec=sys.
> 
> Do we need to somehow pass down that intent to auth_gss? Another idea
> would be to call gssd_running() from the nfs mount code and use that to
> determine whether to try and use krb5 at all...
> 
> Discuss!
> 
> Jeff Layton (3):
>   sunrpc: create a new dummy pipe for gssd to hold open
>   sunrpc: replace sunrpc_net->gssd_running flag with a more reliable
>     check
>   nfs: check if gssd is running before attempting to use krb5i auth in
>     SETCLIENTID call
> 
>  fs/nfs/client.c                    |   5 +-
>  fs/nfs/internal.h                  |   4 +-
>  fs/nfs/nfs4client.c                |   8 ++-
>  include/linux/nfs_xdr.h            |   2 +-
>  include/linux/sunrpc/auth_gss.h    |  10 ++++
>  include/linux/sunrpc/rpc_pipe_fs.h |   7 ++-
>  net/sunrpc/auth_gss/auth_gss.c     |  19 +++++--
>  net/sunrpc/netns.h                 |   3 +-
>  net/sunrpc/rpc_pipe.c              | 104 ++++++++++++++++++++++++++++++++++---
>  net/sunrpc/sunrpc_syms.c           |   8 ++-
>  10 files changed, 147 insertions(+), 23 deletions(-)
> 
> -- 
> 1.8.3.1
> 
> --
> 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

  parent reply	other threads:[~2013-11-14 19:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13 14:30 [PATCH v2 0/3] sunrpc/nfs: more reliable detection of running gssd Jeff Layton
2013-11-13 14:30 ` [PATCH v2 1/3] sunrpc: create a new dummy pipe for gssd to hold open Jeff Layton
2013-11-13 14:30 ` [PATCH v2 2/3] sunrpc: replace sunrpc_net->gssd_running flag with a more reliable check Jeff Layton
2013-11-13 14:30 ` [PATCH v2 3/3] nfs: check if gssd is running before attempting to use krb5i auth in SETCLIENTID call Jeff Layton
2013-11-13 14:38   ` Chuck Lever
2013-11-13 14:48     ` Myklebust, Trond
2013-11-13 15:14       ` Chuck Lever
2013-11-13 15:35         ` Jeff Layton
2013-11-13 15:49           ` Myklebust, Trond
2013-11-13 15:57             ` Jeff Layton
2013-11-13 16:09               ` Jeff Layton
2013-11-13 16:10                 ` Chuck Lever
2013-11-13 16:20                   ` Jeff Layton
2013-11-13 17:05                     ` Chuck Lever
2013-11-13 16:12             ` Chuck Lever
2013-11-13 16:57           ` Chuck Lever
2013-11-14 19:26 ` J. Bruce Fields [this message]
2013-11-14 20:35   ` [PATCH v2 0/3] sunrpc/nfs: more reliable detection of running gssd Jeff Layton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131114192601.GC21152@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=chuck.lever@oracle.com \
    --cc=jlayton@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=steved@redhat.com \
    --cc=trond.myklebust@netapp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).