2013-11-12 13:00:31

by Jeff Layton

[permalink] [raw]
Subject: [PATCH 0/2] sunrpc: more reliable detection of running gssd

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.

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 (2):
sunrpc: create a new dummy pipe for gssd to hold open
sunrpc: replace sunrpc_net->gssd_running flag with a better mechanism

include/linux/sunrpc/rpc_pipe_fs.h | 4 ++
net/sunrpc/auth_gss/auth_gss.c | 13 ++++--
net/sunrpc/netns.h | 3 +-
net/sunrpc/rpc_pipe.c | 95 ++++++++++++++++++++++++++++++++++++--
4 files changed, 106 insertions(+), 9 deletions(-)

--
1.8.3.1



2013-11-12 16:58:46

by Myklebust, Trond

[permalink] [raw]
Subject: Re: [PATCH 0/2] sunrpc: more reliable detection of running gssd

On Tue, 2013-11-12 at 11:15 -0500, Chuck Lever wrote:
+AD4- On Nov 12, 2013, at 11:08 AM, Jeff Layton +ADw-jlayton+AEA-redhat.com+AD4- wrote:
+AD4-
+AD4- +AD4- On Tue, 12 Nov 2013 11:02:42 -0500
+AD4- +AD4- Chuck Lever +ADw-chuck.lever+AEA-oracle.com+AD4- wrote:
+AD4- +AD4-
+AD4- +AD4APg-
+AD4- +AD4APg- On Nov 12, 2013, at 8:00 AM, Jeff Layton +ADw-jlayton+AEA-redhat.com+AD4- wrote:
+AD4- +AD4APg-
+AD4- +AD4- What's the module loading solution?
+AD4-
+AD4- Load auth+AF8-rpcgss.ko only when rpc.gssd has been started. See the +ACIAWw-PATCH+AF0- Adding the nfs4+AF8-secure+AF8-mounts bool+ACI- thread... If auth+AF8-rpcgss.ko is not loaded, the kernel won't ever try to do an upcall.
+AD4-
+AD4- Then, systemd can be used to restart rpc.gssd if it crashes, maybe? Just a thought.

You can trivially defeat that by compiling the gss code into the kernel.

--
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust+AEA-netapp.com
http://www.netapp.com

2013-11-12 22:37:43

by Jeff Layton

[permalink] [raw]
Subject: Re: [PATCH 0/2] sunrpc: more reliable detection of running gssd

On Wed, 13 Nov 2013 09:15:37 +1100
NeilBrown <[email protected]> wrote:

> On Tue, 12 Nov 2013 10:21:40 -0500 Steve Dickson <[email protected]> wrote:
>
> > On 12/11/13 08:00, Jeff Layton wrote:
> > > 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.
> > >
> > > 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!
> > I've just verified that a mount, with these patches, takes about
> > 1.2 seconds when rpc.gssd is not running.... With rpc.gssd it
> > take about .2 seconds.
> >
> > Tested-by: Steve Dickson <[email protected]>
> >
>
> Still sounds like about one second too long.
>
> In that patch I see:
>
> timeout = 15 * HZ;
> - if (!sn->gssd_running)
> + if (!gssd_running(sn))
> timeout = HZ >> 2;
>

Yeah, it's not clear to me where the extra delay there comes from
either. I was sort of hoping Steve would track that down... ;)

> Given that "!gssd_running(sn)" is now certain knowledge rather than a hint,
> can't we just skip the upcall and any timeout?
> i.e.
> timeout = 15 * HZ;
> - if (!sn->gssd_running)
> + if (!gssd_running(sn))
> - timeout = HZ >> 2;
> + return -EACCES;
>

Good point...I was trying to keep the semantic changes to a minimum,
but that does make sense. One minor nit...with the above you'll never
hit warn_gss(), so it probably makes sense to put that in there too.

I've got a v2 of the patchset that I'm working on that fixes a couple
of bugs, makes the dir name change that Trond wants, and also has a
patch that makes nfs4_init_client skip trying krb5i if gssd isn't up.
I'll probably post that tomorrow...

--
Jeff Layton <[email protected]>


Attachments:
signature.asc (836.00 B)

2013-11-12 16:08:34

by Jeff Layton

[permalink] [raw]
Subject: Re: [PATCH 0/2] sunrpc: more reliable detection of running gssd

On Tue, 12 Nov 2013 11:02:42 -0500
Chuck Lever <[email protected]> wrote:

>
> On Nov 12, 2013, at 8:00 AM, Jeff Layton <[email protected]> wrote:
>
> > 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.
> >
> > 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!
>
> I'd like to pursue the module loading solution as well.
>

Sorry, I missed that part of the discussion.

What's the module loading solution?

--
Jeff Layton <[email protected]>

2013-11-12 16:15:51

by Chuck Lever III

[permalink] [raw]
Subject: Re: [PATCH 0/2] sunrpc: more reliable detection of running gssd


On Nov 12, 2013, at 11:08 AM, Jeff Layton <[email protected]> wrote:

> On Tue, 12 Nov 2013 11:02:42 -0500
> Chuck Lever <[email protected]> wrote:
>
>>
>> On Nov 12, 2013, at 8:00 AM, Jeff Layton <[email protected]> wrote:
>>
>>> 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.
>>>
>>> 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!
>>
>> I'd like to pursue the module loading solution as well.
>>
>
> Sorry, I missed that part of the discussion.
>
> What's the module loading solution?

Load auth_rpcgss.ko only when rpc.gssd has been started. See the "[PATCH] Adding the nfs4_secure_mounts bool" thread... If auth_rpcgss.ko is not loaded, the kernel won't ever try to do an upcall.

Then, systemd can be used to restart rpc.gssd if it crashes, maybe? Just a thought.

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com





2013-11-12 13:00:33

by Jeff Layton

[permalink] [raw]
Subject: [PATCH 1/2] sunrpc: create a new dummy pipe for gssd to hold open

rpc.gssd will naturally hold open any pipe named */clnt*/gssd that shows
up under rpc_pipefs. That behavior gives us a reliable mechanism to tell
whether it's actually running or not.

Create a new toplevel "dummy" directory in rpc_pipefs when it's mounted.
Under that directory create another directory called "clntXX", and then
within that a pipe called "gssd".

We'll never send an upcall along that pipe, and any downcall written to
it will just return -EINVAL.

Signed-off-by: Jeff Layton <[email protected]>
---
net/sunrpc/netns.h | 1 +
net/sunrpc/rpc_pipe.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 85 insertions(+)

diff --git a/net/sunrpc/netns.h b/net/sunrpc/netns.h
index 779742c..6b82968 100644
--- a/net/sunrpc/netns.h
+++ b/net/sunrpc/netns.h
@@ -15,6 +15,7 @@ struct sunrpc_net {

struct super_block *pipefs_sb;
struct mutex pipefs_sb_lock;
+ struct dentry *gssd_dummy;

struct list_head all_clients;
spinlock_t rpc_client_lock;
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index f94567b..1c54de6 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -1168,6 +1168,7 @@ enum {
RPCAUTH_nfsd4_cb,
RPCAUTH_cache,
RPCAUTH_nfsd,
+ RPCAUTH_dummy,
RPCAUTH_RootEOF
};

@@ -1204,6 +1205,10 @@ static const struct rpc_filelist files[] = {
.name = "nfsd",
.mode = S_IFDIR | S_IRUGO | S_IXUGO,
},
+ [RPCAUTH_dummy] = {
+ .name = "dummy",
+ .mode = S_IFDIR | S_IRUGO | S_IXUGO,
+ },
};

/*
@@ -1253,6 +1258,80 @@ void rpc_put_sb_net(const struct net *net)
}
EXPORT_SYMBOL_GPL(rpc_put_sb_net);

+static const struct rpc_filelist dummy_clnt_dir[] = {
+ [0] = {
+ .name = "clntXX",
+ .mode = S_IFDIR | S_IRUGO | S_IXUGO,
+ },
+};
+
+static ssize_t
+dummy_downcall(struct file *filp, const char __user *src, size_t len)
+{
+ return -EINVAL;
+}
+
+static const struct rpc_pipe_ops dummy_pipe_ops = {
+ .upcall = rpc_pipe_generic_upcall,
+ .downcall = dummy_downcall,
+};
+
+/**
+ * rpc_gssd_dummy_populate - create a dummy gssd pipe
+ * @root: root of the rpc_pipefs filesystem
+ *
+ * Create a dummy set of directories and a pipe that gssd can hold open to
+ * indicate that it is up and running.
+ */
+static struct dentry *
+rpc_gssd_dummy_populate(struct dentry *root)
+{
+ int ret = 0;
+ struct dentry *gssd_dentry;
+ struct dentry *clnt_dentry = NULL;
+ struct dentry *pipe_dentry = NULL;
+ struct rpc_pipe *pipe_data = NULL;
+ struct qstr q = QSTR_INIT(files[RPCAUTH_dummy].name,
+ strlen(files[RPCAUTH_dummy].name));
+
+ /* We should never get this far if "gssd" doesn't exist */
+ gssd_dentry = d_hash_and_lookup(root, &q);
+ if (!gssd_dentry)
+ return ERR_PTR(-ENOENT);
+
+ ret = rpc_populate(gssd_dentry, dummy_clnt_dir, 0, 1, NULL);
+ if (ret) {
+ pipe_dentry = ERR_PTR(ret);
+ goto out;
+ }
+
+ pipe_data = rpc_mkpipe_data(&dummy_pipe_ops, 0);
+ if (IS_ERR(pipe_data)) {
+ pipe_dentry = ERR_CAST(pipe_data);
+ pipe_data = NULL;
+ goto out;
+ }
+
+ q.name = dummy_clnt_dir[0].name;
+ q.len = strlen(dummy_clnt_dir[0].name);
+ clnt_dentry = d_hash_and_lookup(gssd_dentry, &q);
+ if (!clnt_dentry) {
+ pipe_dentry = ERR_PTR(-ENOENT);
+ goto out;
+ }
+
+ pipe_dentry = rpc_mkpipe_dentry(clnt_dentry, "gssd", NULL, pipe_data);
+ if (IS_ERR(pipe_dentry))
+ goto out;
+
+ pipe_data = NULL;
+out:
+ rpc_destroy_pipe_data(pipe_data);
+ dput(clnt_dentry);
+ dput(gssd_dentry);
+ return pipe_dentry;
+}
+
static int
rpc_fill_super(struct super_block *sb, void *data, int silent)
{
@@ -1275,6 +1354,11 @@ rpc_fill_super(struct super_block *sb, void *data, int silent)
return -ENOMEM;
if (rpc_populate(root, files, RPCAUTH_lockd, RPCAUTH_RootEOF, NULL))
return -ENOMEM;
+
+ sn->gssd_dummy = rpc_gssd_dummy_populate(root);
+ if (IS_ERR(sn->gssd_dummy))
+ return PTR_ERR(sn->gssd_dummy);
+
dprintk("RPC: sending pipefs MOUNT notification for net %p%s\n",
net, NET_NAME(net));
mutex_lock(&sn->pipefs_sb_lock);
--
1.8.3.1


2013-11-12 17:44:37

by Jeff Layton

[permalink] [raw]
Subject: Re: [PATCH 1/2] sunrpc: create a new dummy pipe for gssd to hold open

On Tue, 12 Nov 2013 17:36:15 +0000
"Myklebust, Trond" <[email protected]> wrote:

> On Tue, 2013-11-12 at 08:00 -0500, Jeff Layton wrote:
> > rpc.gssd will naturally hold open any pipe named */clnt*/gssd that shows
> > up under rpc_pipefs. That behavior gives us a reliable mechanism to tell
> > whether it's actually running or not.
> >
> > Create a new toplevel "dummy" directory in rpc_pipefs when it's mounted.
> > Under that directory create another directory called "clntXX", and then
> > within that a pipe called "gssd".
> >
> > We'll never send an upcall along that pipe, and any downcall written to
> > it will just return -EINVAL.
> >
> > Signed-off-by: Jeff Layton <[email protected]>
> > ---
> > net/sunrpc/netns.h | 1 +
> > net/sunrpc/rpc_pipe.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++++++
> > 2 files changed, 85 insertions(+)
> >
> > diff --git a/net/sunrpc/netns.h b/net/sunrpc/netns.h
> > index 779742c..6b82968 100644
> > --- a/net/sunrpc/netns.h
> > +++ b/net/sunrpc/netns.h
> > @@ -15,6 +15,7 @@ struct sunrpc_net {
> >
> > struct super_block *pipefs_sb;
> > struct mutex pipefs_sb_lock;
> > + struct dentry *gssd_dummy;
> >
> > struct list_head all_clients;
> > spinlock_t rpc_client_lock;
> > diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
> > index f94567b..1c54de6 100644
> > --- a/net/sunrpc/rpc_pipe.c
> > +++ b/net/sunrpc/rpc_pipe.c
> > @@ -1168,6 +1168,7 @@ enum {
> > RPCAUTH_nfsd4_cb,
> > RPCAUTH_cache,
> > RPCAUTH_nfsd,
> > + RPCAUTH_dummy,
> > RPCAUTH_RootEOF
> > };
> >
> > @@ -1204,6 +1205,10 @@ static const struct rpc_filelist files[] = {
> > .name = "nfsd",
> > .mode = S_IFDIR | S_IRUGO | S_IXUGO,
> > },
> > + [RPCAUTH_dummy] = {
> > + .name = "dummy",
>
> "gssd" would be nicer.
>

Ha! That's what my original patch had, but I thought that made it look
too legit. I can respin and change it though if you like...

> > + .mode = S_IFDIR | S_IRUGO | S_IXUGO,
> > + },
> > };
> >
> > /*
> > @@ -1253,6 +1258,80 @@ void rpc_put_sb_net(const struct net *net)
> > }
> > EXPORT_SYMBOL_GPL(rpc_put_sb_net);
> >
> > +static const struct rpc_filelist dummy_clnt_dir[] = {
> > + [0] = {
> > + .name = "clntXX",
> > + .mode = S_IFDIR | S_IRUGO | S_IXUGO,
> > + },
> > +};
> > +
> > +static ssize_t
> > +dummy_downcall(struct file *filp, const char __user *src, size_t len)
> > +{
> > + return -EINVAL;
> > +}
> > +
> > +static const struct rpc_pipe_ops dummy_pipe_ops = {
> > + .upcall = rpc_pipe_generic_upcall,
> > + .downcall = dummy_downcall,
> > +};
> > +
> > +/**
> > + * rpc_gssd_dummy_populate - create a dummy gssd pipe
> > + * @root: root of the rpc_pipefs filesystem
> > + *
> > + * Create a dummy set of directories and a pipe that gssd can hold open to
> > + * indicate that it is up and running.
> > + */
> > +static struct dentry *
> > +rpc_gssd_dummy_populate(struct dentry *root)
> > +{
> > + int ret = 0;
> > + struct dentry *gssd_dentry;
> > + struct dentry *clnt_dentry = NULL;
> > + struct dentry *pipe_dentry = NULL;
> > + struct rpc_pipe *pipe_data = NULL;
> > + struct qstr q = QSTR_INIT(files[RPCAUTH_dummy].name,
> > + strlen(files[RPCAUTH_dummy].name));
> > +
> > + /* We should never get this far if "gssd" doesn't exist */
> > + gssd_dentry = d_hash_and_lookup(root, &q);
> > + if (!gssd_dentry)
> > + return ERR_PTR(-ENOENT);
> > +
> > + ret = rpc_populate(gssd_dentry, dummy_clnt_dir, 0, 1, NULL);
> > + if (ret) {
> > + pipe_dentry = ERR_PTR(ret);
> > + goto out;
> > + }
> > +
> > + pipe_data = rpc_mkpipe_data(&dummy_pipe_ops, 0);
> > + if (IS_ERR(pipe_data)) {
> > + pipe_dentry = ERR_CAST(pipe_data);
> > + pipe_data = NULL;
> > + goto out;
> > + }
> > +
> > + q.name = dummy_clnt_dir[0].name;
> > + q.len = strlen(dummy_clnt_dir[0].name);
> > + clnt_dentry = d_hash_and_lookup(gssd_dentry, &q);
> > + if (!clnt_dentry) {
> > + pipe_dentry = ERR_PTR(-ENOENT);
> > + goto out;
> > + }
> > +
> > + pipe_dentry = rpc_mkpipe_dentry(clnt_dentry, "gssd", NULL, pipe_data);
> > + if (IS_ERR(pipe_dentry))
> > + goto out;
> > +
> > + pipe_data = NULL;
> > +out:
> > + rpc_destroy_pipe_data(pipe_data);
> > + dput(clnt_dentry);
> > + dput(gssd_dentry);
> > + return pipe_dentry;
> > +}
> > +
> > static int
> > rpc_fill_super(struct super_block *sb, void *data, int silent)
> > {
> > @@ -1275,6 +1354,11 @@ rpc_fill_super(struct super_block *sb, void *data, int silent)
> > return -ENOMEM;
> > if (rpc_populate(root, files, RPCAUTH_lockd, RPCAUTH_RootEOF, NULL))
> > return -ENOMEM;
> > +
> > + sn->gssd_dummy = rpc_gssd_dummy_populate(root);
> > + if (IS_ERR(sn->gssd_dummy))
> > + return PTR_ERR(sn->gssd_dummy);
> > +
> > dprintk("RPC: sending pipefs MOUNT notification for net %p%s\n",
> > net, NET_NAME(net));
> > mutex_lock(&sn->pipefs_sb_lock);
>


--
Jeff Layton <[email protected]>

2013-11-12 17:12:54

by Chuck Lever III

[permalink] [raw]
Subject: Re: [PATCH 0/2] sunrpc: more reliable detection of running gssd


On Nov 12, 2013, at 11:56 AM, "Myklebust, Trond" <[email protected]> wrote:

> On Tue, 2013-11-12 at 11:15 -0500, Chuck Lever wrote:
>> On Nov 12, 2013, at 11:08 AM, Jeff Layton <[email protected]> wrote:
>>
>>> On Tue, 12 Nov 2013 11:02:42 -0500
>>> Chuck Lever <[email protected]> wrote:
>>>
>>>>
>>>> On Nov 12, 2013, at 8:00 AM, Jeff Layton <[email protected]> wrote:
>>>>
>>> What's the module loading solution?
>>
>> Load auth_rpcgss.ko only when rpc.gssd has been started. See the "[PATCH] Adding the nfs4_secure_mounts bool" thread... If auth_rpcgss.ko is not loaded, the kernel won't ever try to do an upcall.
>>
>> Then, systemd can be used to restart rpc.gssd if it crashes, maybe? Just a thought.
>
> You can trivially defeat that by compiling the gss code into the kernel.

My solution is a workaround. It works for distributions that do not compile auth_rpcgss into the kernel, since they are the ones who provide an appropriate init script architecture.

But it does not require a kernel code change, and it applies to every distribution I'm aware of. Since distributions typically do not use built-in GSS support, I'm not too concerned about whoever might be left over.

And I never said that we shouldn't continue to mitigate the upcall timeout. Note that Jeff's solution didn't entirely eliminate the problem either. With either or both of these solutions in place, we are better off than we were before.

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com





2013-11-12 17:56:02

by Myklebust, Trond

[permalink] [raw]
Subject: Re: [PATCH 1/2] sunrpc: create a new dummy pipe for gssd to hold open

On Tue, 2013-11-12 at 12:44 -0500, Jeff Layton wrote:
+AD4- On Tue, 12 Nov 2013 17:36:15 +-0000
+AD4- +ACI-Myklebust, Trond+ACI- +ADw-Trond.Myklebust+AEA-netapp.com+AD4- wrote:
+AD4-
+AD4- +AD4- On Tue, 2013-11-12 at 08:00 -0500, Jeff Layton wrote:
+AD4- +AD4- +AD4- rpc.gssd will naturally hold open any pipe named +ACo-/clnt+ACo-/gssd that shows
+AD4- +AD4- +AD4- up under rpc+AF8-pipefs. That behavior gives us a reliable mechanism to tell
+AD4- +AD4- +AD4- whether it's actually running or not.
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- Create a new toplevel +ACI-dummy+ACI- directory in rpc+AF8-pipefs when it's mounted.
+AD4- +AD4- +AD4- Under that directory create another directory called +ACI-clntXX+ACI-, and then
+AD4- +AD4- +AD4- within that a pipe called +ACI-gssd+ACI-.
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- We'll never send an upcall along that pipe, and any downcall written to
+AD4- +AD4- +AD4- it will just return -EINVAL.
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- Signed-off-by: Jeff Layton +ADw-jlayton+AEA-redhat.com+AD4-
+AD4- +AD4- +AD4- ---
+AD4- +AD4- +AD4- net/sunrpc/netns.h +AHw- 1 +-
+AD4- +AD4- +AD4- net/sunrpc/rpc+AF8-pipe.c +AHw- 84 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+AD4- +AD4- +AD4- 2 files changed, 85 insertions(+-)
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- diff --git a/net/sunrpc/netns.h b/net/sunrpc/netns.h
+AD4- +AD4- +AD4- index 779742c..6b82968 100644
+AD4- +AD4- +AD4- --- a/net/sunrpc/netns.h
+AD4- +AD4- +AD4- +-+-+- b/net/sunrpc/netns.h
+AD4- +AD4- +AD4- +AEAAQA- -15,6 +-15,7 +AEAAQA- struct sunrpc+AF8-net +AHs-
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- struct super+AF8-block +ACo-pipefs+AF8-sb+ADs-
+AD4- +AD4- +AD4- struct mutex pipefs+AF8-sb+AF8-lock+ADs-
+AD4- +AD4- +AD4- +- struct dentry +ACo-gssd+AF8-dummy+ADs-
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- struct list+AF8-head all+AF8-clients+ADs-
+AD4- +AD4- +AD4- spinlock+AF8-t rpc+AF8-client+AF8-lock+ADs-
+AD4- +AD4- +AD4- diff --git a/net/sunrpc/rpc+AF8-pipe.c b/net/sunrpc/rpc+AF8-pipe.c
+AD4- +AD4- +AD4- index f94567b..1c54de6 100644
+AD4- +AD4- +AD4- --- a/net/sunrpc/rpc+AF8-pipe.c
+AD4- +AD4- +AD4- +-+-+- b/net/sunrpc/rpc+AF8-pipe.c
+AD4- +AD4- +AD4- +AEAAQA- -1168,6 +-1168,7 +AEAAQA- enum +AHs-
+AD4- +AD4- +AD4- RPCAUTH+AF8-nfsd4+AF8-cb,
+AD4- +AD4- +AD4- RPCAUTH+AF8-cache,
+AD4- +AD4- +AD4- RPCAUTH+AF8-nfsd,
+AD4- +AD4- +AD4- +- RPCAUTH+AF8-dummy,
+AD4- +AD4- +AD4- RPCAUTH+AF8-RootEOF
+AD4- +AD4- +AD4- +AH0AOw-
+AD4- +AD4- +AD4-
+AD4- +AD4- +AD4- +AEAAQA- -1204,6 +-1205,10 +AEAAQA- static const struct rpc+AF8-filelist files+AFsAXQ- +AD0- +AHs-
+AD4- +AD4- +AD4- .name +AD0- +ACI-nfsd+ACI-,
+AD4- +AD4- +AD4- .mode +AD0- S+AF8-IFDIR +AHw- S+AF8-IRUGO +AHw- S+AF8-IXUGO,
+AD4- +AD4- +AD4- +AH0-,
+AD4- +AD4- +AD4- +- +AFs-RPCAUTH+AF8-dummy+AF0- +AD0- +AHs-
+AD4- +AD4- +AD4- +- .name +AD0- +ACI-dummy+ACI-,
+AD4- +AD4-
+AD4- +AD4- +ACI-gssd+ACI- would be nicer.
+AD4- +AD4-
+AD4-
+AD4- Ha+ACE- That's what my original patch had, but I thought that made it look
+AD4- too legit. I can respin and change it though if you like...

I'd prefer that. At least 'gssd' makes it clear that this is a directory
that we want gssd to be snooping.

--
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust+AEA-netapp.com
http://www.netapp.com

2013-11-12 13:00:34

by Jeff Layton

[permalink] [raw]
Subject: [PATCH 2/2] sunrpc: replace sunrpc_net->gssd_running flag with a better mechanism

Now that we have a more reliable method to tell if gssd is running, we
can replace the sn->gssd_running flag with a function that will query to
see if it's up and running.

Signed-off-by: Jeff Layton <[email protected]>
---
include/linux/sunrpc/rpc_pipe_fs.h | 4 ++++
net/sunrpc/auth_gss/auth_gss.c | 13 ++++++++++---
net/sunrpc/netns.h | 2 --
net/sunrpc/rpc_pipe.c | 11 +++++++----
4 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h
index a353e03..0ba459f 100644
--- a/include/linux/sunrpc/rpc_pipe_fs.h
+++ b/include/linux/sunrpc/rpc_pipe_fs.h
@@ -5,6 +5,8 @@

#include <linux/workqueue.h>

+struct sunrpc_net;
+
struct rpc_pipe_dir_head {
struct list_head pdh_entries;
struct dentry *pdh_dentry;
@@ -130,5 +132,7 @@ extern int rpc_unlink(struct dentry *);
extern int register_rpc_pipefs(void);
extern void unregister_rpc_pipefs(void);

+extern bool rpc_pipe_is_open(struct rpc_pipe *pipe);
+
#endif
#endif
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index 97912b4..d324563 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -592,6 +592,15 @@ out:
return err;
}

+static bool
+gssd_running(struct sunrpc_net *sn)
+{
+ struct inode *inode = sn->gssd_dummy->d_inode;
+ struct rpc_pipe *pipe = RPC_I(inode)->pipe;
+
+ return rpc_pipe_is_open(pipe);
+}
+
static inline int
gss_create_upcall(struct gss_auth *gss_auth, struct gss_cred *gss_cred)
{
@@ -610,15 +619,13 @@ retry:
err = 0;
/* Default timeout is 15s unless we know that gssd is not running */
timeout = 15 * HZ;
- if (!sn->gssd_running)
+ if (!gssd_running(sn))
timeout = HZ >> 2;
gss_msg = gss_setup_upcall(gss_auth, cred);
if (PTR_ERR(gss_msg) == -EAGAIN) {
err = wait_event_interruptible_timeout(pipe_version_waitqueue,
sn->pipe_version >= 0, timeout);
if (sn->pipe_version < 0) {
- if (err == 0)
- sn->gssd_running = 0;
warn_gssd();
err = -EACCES;
}
diff --git a/net/sunrpc/netns.h b/net/sunrpc/netns.h
index 6b82968..39ab6bc 100644
--- a/net/sunrpc/netns.h
+++ b/net/sunrpc/netns.h
@@ -33,8 +33,6 @@ struct sunrpc_net {
int pipe_version;
atomic_t pipe_users;
struct proc_dir_entry *use_gssp_proc;
-
- unsigned int gssd_running;
};

extern int sunrpc_net_id;
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 1c54de6..497261f 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -216,14 +216,11 @@ rpc_destroy_inode(struct inode *inode)
static int
rpc_pipe_open(struct inode *inode, struct file *filp)
{
- struct net *net = inode->i_sb->s_fs_info;
- struct sunrpc_net *sn = net_generic(net, sunrpc_net_id);
struct rpc_pipe *pipe;
int first_open;
int res = -ENXIO;

mutex_lock(&inode->i_mutex);
- sn->gssd_running = 1;
pipe = RPC_I(inode)->pipe;
if (pipe == NULL)
goto out;
@@ -1227,7 +1224,6 @@ void rpc_pipefs_init_net(struct net *net)
struct sunrpc_net *sn = net_generic(net, sunrpc_net_id);

mutex_init(&sn->pipefs_sb_lock);
- sn->gssd_running = 1;
sn->pipe_version = -1;
}

@@ -1382,6 +1378,13 @@ err_depopulate:
return err;
}

+bool
+rpc_pipe_is_open(struct rpc_pipe *pipe)
+{
+ return (pipe->nreaders || pipe->nwriters);
+}
+EXPORT_SYMBOL_GPL(rpc_pipe_is_open);
+
static struct dentry *
rpc_mount(struct file_system_type *fs_type,
int flags, const char *dev_name, void *data)
--
1.8.3.1


2013-11-12 17:13:54

by Chuck Lever III

[permalink] [raw]
Subject: Re: [PATCH 0/2] sunrpc: more reliable detection of running gssd


On Nov 12, 2013, at 11:56 AM, "Myklebust, Trond" <[email protected]> wrote:

> On Tue, 2013-11-12 at 11:15 -0500, Chuck Lever wrote:
>> On Nov 12, 2013, at 11:08 AM, Jeff Layton <[email protected]> wrote:
>>
>>> On Tue, 12 Nov 2013 11:02:42 -0500
>>> Chuck Lever <[email protected]> wrote:
>>>
>>>>
>>>> On Nov 12, 2013, at 8:00 AM, Jeff Layton <[email protected]> wrote:
>>>>
>>> What's the module loading solution?
>>
>> Load auth_rpcgss.ko only when rpc.gssd has been started. See the "[PATCH] Adding the nfs4_secure_mounts bool" thread... If auth_rpcgss.ko is not loaded, the kernel won't ever try to do an upcall.
>>
>> Then, systemd can be used to restart rpc.gssd if it crashes, maybe? Just a thought.
>
> You can trivially defeat that by compiling the gss code into the kernel.

And also: my preferred solution is to run rpc.gssd unconditionally. But some find that onerous.

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com





2013-11-12 22:15:52

by NeilBrown

[permalink] [raw]
Subject: Re: [PATCH 0/2] sunrpc: more reliable detection of running gssd

On Tue, 12 Nov 2013 10:21:40 -0500 Steve Dickson <[email protected]> wrote:

> On 12/11/13 08:00, Jeff Layton wrote:
> > 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.
> >
> > 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!
> I've just verified that a mount, with these patches, takes about
> 1.2 seconds when rpc.gssd is not running.... With rpc.gssd it
> take about .2 seconds.
>
> Tested-by: Steve Dickson <[email protected]>
>

Still sounds like about one second too long.

In that patch I see:

timeout = 15 * HZ;
- if (!sn->gssd_running)
+ if (!gssd_running(sn))
timeout = HZ >> 2;

Given that "!gssd_running(sn)" is now certain knowledge rather than a hint,
can't we just skip the upcall and any timeout?
i.e.
timeout = 15 * HZ;
- if (!sn->gssd_running)
+ if (!gssd_running(sn))
- timeout = HZ >> 2;
+ return -EACCES;

??

NeilBrown


Attachments:
signature.asc (828.00 B)

2013-11-12 16:02:50

by Chuck Lever III

[permalink] [raw]
Subject: Re: [PATCH 0/2] sunrpc: more reliable detection of running gssd


On Nov 12, 2013, at 8:00 AM, Jeff Layton <[email protected]> wrote:

> 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.
>
> 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!

I'd like to pursue the module loading solution as well.


>
> Jeff Layton (2):
> sunrpc: create a new dummy pipe for gssd to hold open
> sunrpc: replace sunrpc_net->gssd_running flag with a better mechanism
>
> include/linux/sunrpc/rpc_pipe_fs.h | 4 ++
> net/sunrpc/auth_gss/auth_gss.c | 13 ++++--
> net/sunrpc/netns.h | 3 +-
> net/sunrpc/rpc_pipe.c | 95 ++++++++++++++++++++++++++++++++++++--
> 4 files changed, 106 insertions(+), 9 deletions(-)
>
> --
> 1.8.3.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com





2013-11-12 15:20:41

by Steve Dickson

[permalink] [raw]
Subject: Re: [PATCH 0/2] sunrpc: more reliable detection of running gssd

On 12/11/13 08:00, Jeff Layton wrote:
> 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.
>
> 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!
I've just verified that a mount, with these patches, takes about
1.2 seconds when rpc.gssd is not running.... With rpc.gssd it
take about .2 seconds.

Tested-by: Steve Dickson <[email protected]>

steved.

2013-11-12 17:36:17

by Myklebust, Trond

[permalink] [raw]
Subject: Re: [PATCH 1/2] sunrpc: create a new dummy pipe for gssd to hold open

On Tue, 2013-11-12 at 08:00 -0500, Jeff Layton wrote:
+AD4- rpc.gssd will naturally hold open any pipe named +ACo-/clnt+ACo-/gssd that shows
+AD4- up under rpc+AF8-pipefs. That behavior gives us a reliable mechanism to tell
+AD4- whether it's actually running or not.
+AD4-
+AD4- Create a new toplevel +ACI-dummy+ACI- directory in rpc+AF8-pipefs when it's mounted.
+AD4- Under that directory create another directory called +ACI-clntXX+ACI-, and then
+AD4- within that a pipe called +ACI-gssd+ACI-.
+AD4-
+AD4- We'll never send an upcall along that pipe, and any downcall written to
+AD4- it will just return -EINVAL.
+AD4-
+AD4- Signed-off-by: Jeff Layton +ADw-jlayton+AEA-redhat.com+AD4-
+AD4- ---
+AD4- net/sunrpc/netns.h +AHw- 1 +-
+AD4- net/sunrpc/rpc+AF8-pipe.c +AHw- 84 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
+AD4- 2 files changed, 85 insertions(+-)
+AD4-
+AD4- diff --git a/net/sunrpc/netns.h b/net/sunrpc/netns.h
+AD4- index 779742c..6b82968 100644
+AD4- --- a/net/sunrpc/netns.h
+AD4- +-+-+- b/net/sunrpc/netns.h
+AD4- +AEAAQA- -15,6 +-15,7 +AEAAQA- struct sunrpc+AF8-net +AHs-
+AD4-
+AD4- struct super+AF8-block +ACo-pipefs+AF8-sb+ADs-
+AD4- struct mutex pipefs+AF8-sb+AF8-lock+ADs-
+AD4- +- struct dentry +ACo-gssd+AF8-dummy+ADs-
+AD4-
+AD4- struct list+AF8-head all+AF8-clients+ADs-
+AD4- spinlock+AF8-t rpc+AF8-client+AF8-lock+ADs-
+AD4- diff --git a/net/sunrpc/rpc+AF8-pipe.c b/net/sunrpc/rpc+AF8-pipe.c
+AD4- index f94567b..1c54de6 100644
+AD4- --- a/net/sunrpc/rpc+AF8-pipe.c
+AD4- +-+-+- b/net/sunrpc/rpc+AF8-pipe.c
+AD4- +AEAAQA- -1168,6 +-1168,7 +AEAAQA- enum +AHs-
+AD4- RPCAUTH+AF8-nfsd4+AF8-cb,
+AD4- RPCAUTH+AF8-cache,
+AD4- RPCAUTH+AF8-nfsd,
+AD4- +- RPCAUTH+AF8-dummy,
+AD4- RPCAUTH+AF8-RootEOF
+AD4- +AH0AOw-
+AD4-
+AD4- +AEAAQA- -1204,6 +-1205,10 +AEAAQA- static const struct rpc+AF8-filelist files+AFsAXQ- +AD0- +AHs-
+AD4- .name +AD0- +ACI-nfsd+ACI-,
+AD4- .mode +AD0- S+AF8-IFDIR +AHw- S+AF8-IRUGO +AHw- S+AF8-IXUGO,
+AD4- +AH0-,
+AD4- +- +AFs-RPCAUTH+AF8-dummy+AF0- +AD0- +AHs-
+AD4- +- .name +AD0- +ACI-dummy+ACI-,

+ACI-gssd+ACI- would be nicer.

+AD4- +- .mode +AD0- S+AF8-IFDIR +AHw- S+AF8-IRUGO +AHw- S+AF8-IXUGO,
+AD4- +- +AH0-,
+AD4- +AH0AOw-
+AD4-
+AD4- /+ACo-
+AD4- +AEAAQA- -1253,6 +-1258,80 +AEAAQA- void rpc+AF8-put+AF8-sb+AF8-net(const struct net +ACo-net)
+AD4- +AH0-
+AD4- EXPORT+AF8-SYMBOL+AF8-GPL(rpc+AF8-put+AF8-sb+AF8-net)+ADs-
+AD4-
+AD4- +-static const struct rpc+AF8-filelist dummy+AF8-clnt+AF8-dir+AFsAXQ- +AD0- +AHs-
+AD4- +- +AFs-0+AF0- +AD0- +AHs-
+AD4- +- .name +AD0- +ACI-clntXX+ACI-,
+AD4- +- .mode +AD0- S+AF8-IFDIR +AHw- S+AF8-IRUGO +AHw- S+AF8-IXUGO,
+AD4- +- +AH0-,
+AD4- +-+AH0AOw-
+AD4- +-
+AD4- +-static ssize+AF8-t
+AD4- +-dummy+AF8-downcall(struct file +ACo-filp, const char +AF8AXw-user +ACo-src, size+AF8-t len)
+AD4- +-+AHs-
+AD4- +- return -EINVAL+ADs-
+AD4- +-+AH0-
+AD4- +-
+AD4- +-static const struct rpc+AF8-pipe+AF8-ops dummy+AF8-pipe+AF8-ops +AD0- +AHs-
+AD4- +- .upcall +AD0- rpc+AF8-pipe+AF8-generic+AF8-upcall,
+AD4- +- .downcall +AD0- dummy+AF8-downcall,
+AD4- +-+AH0AOw-
+AD4- +-
+AD4- +-/+ACoAKg-
+AD4- +- +ACo- rpc+AF8-gssd+AF8-dummy+AF8-populate - create a dummy gssd pipe
+AD4- +- +ACo- +AEA-root: root of the rpc+AF8-pipefs filesystem
+AD4- +- +ACo-
+AD4- +- +ACo- Create a dummy set of directories and a pipe that gssd can hold open to
+AD4- +- +ACo- indicate that it is up and running.
+AD4- +- +ACo-/
+AD4- +-static struct dentry +ACo-
+AD4- +-rpc+AF8-gssd+AF8-dummy+AF8-populate(struct dentry +ACo-root)
+AD4- +-+AHs-
+AD4- +- int ret +AD0- 0+ADs-
+AD4- +- struct dentry +ACo-gssd+AF8-dentry+ADs-
+AD4- +- struct dentry +ACo-clnt+AF8-dentry +AD0- NULL+ADs-
+AD4- +- struct dentry +ACo-pipe+AF8-dentry +AD0- NULL+ADs-
+AD4- +- struct rpc+AF8-pipe +ACo-pipe+AF8-data +AD0- NULL+ADs-
+AD4- +- struct qstr q +AD0- QSTR+AF8-INIT(files+AFs-RPCAUTH+AF8-dummy+AF0-.name,
+AD4- +- strlen(files+AFs-RPCAUTH+AF8-dummy+AF0-.name))+ADs-
+AD4- +-
+AD4- +- /+ACo- We should never get this far if +ACI-gssd+ACI- doesn't exist +ACo-/
+AD4- +- gssd+AF8-dentry +AD0- d+AF8-hash+AF8-and+AF8-lookup(root, +ACY-q)+ADs-
+AD4- +- if (+ACE-gssd+AF8-dentry)
+AD4- +- return ERR+AF8-PTR(-ENOENT)+ADs-
+AD4- +-
+AD4- +- ret +AD0- rpc+AF8-populate(gssd+AF8-dentry, dummy+AF8-clnt+AF8-dir, 0, 1, NULL)+ADs-
+AD4- +- if (ret) +AHs-
+AD4- +- pipe+AF8-dentry +AD0- ERR+AF8-PTR(ret)+ADs-
+AD4- +- goto out+ADs-
+AD4- +- +AH0-
+AD4- +-
+AD4- +- pipe+AF8-data +AD0- rpc+AF8-mkpipe+AF8-data(+ACY-dummy+AF8-pipe+AF8-ops, 0)+ADs-
+AD4- +- if (IS+AF8-ERR(pipe+AF8-data)) +AHs-
+AD4- +- pipe+AF8-dentry +AD0- ERR+AF8-CAST(pipe+AF8-data)+ADs-
+AD4- +- pipe+AF8-data +AD0- NULL+ADs-
+AD4- +- goto out+ADs-
+AD4- +- +AH0-
+AD4- +-
+AD4- +- q.name +AD0- dummy+AF8-clnt+AF8-dir+AFs-0+AF0-.name+ADs-
+AD4- +- q.len +AD0- strlen(dummy+AF8-clnt+AF8-dir+AFs-0+AF0-.name)+ADs-
+AD4- +- clnt+AF8-dentry +AD0- d+AF8-hash+AF8-and+AF8-lookup(gssd+AF8-dentry, +ACY-q)+ADs-
+AD4- +- if (+ACE-clnt+AF8-dentry) +AHs-
+AD4- +- pipe+AF8-dentry +AD0- ERR+AF8-PTR(-ENOENT)+ADs-
+AD4- +- goto out+ADs-
+AD4- +- +AH0-
+AD4- +-
+AD4- +- pipe+AF8-dentry +AD0- rpc+AF8-mkpipe+AF8-dentry(clnt+AF8-dentry, +ACI-gssd+ACI-, NULL, pipe+AF8-data)+ADs-
+AD4- +- if (IS+AF8-ERR(pipe+AF8-dentry))
+AD4- +- goto out+ADs-
+AD4- +-
+AD4- +- pipe+AF8-data +AD0- NULL+ADs-
+AD4- +-out:
+AD4- +- rpc+AF8-destroy+AF8-pipe+AF8-data(pipe+AF8-data)+ADs-
+AD4- +- dput(clnt+AF8-dentry)+ADs-
+AD4- +- dput(gssd+AF8-dentry)+ADs-
+AD4- +- return pipe+AF8-dentry+ADs-
+AD4- +-+AH0-
+AD4- +-
+AD4- static int
+AD4- rpc+AF8-fill+AF8-super(struct super+AF8-block +ACo-sb, void +ACo-data, int silent)
+AD4- +AHs-
+AD4- +AEAAQA- -1275,6 +-1354,11 +AEAAQA- rpc+AF8-fill+AF8-super(struct super+AF8-block +ACo-sb, void +ACo-data, int silent)
+AD4- return -ENOMEM+ADs-
+AD4- if (rpc+AF8-populate(root, files, RPCAUTH+AF8-lockd, RPCAUTH+AF8-RootEOF, NULL))
+AD4- return -ENOMEM+ADs-
+AD4- +-
+AD4- +- sn-+AD4-gssd+AF8-dummy +AD0- rpc+AF8-gssd+AF8-dummy+AF8-populate(root)+ADs-
+AD4- +- if (IS+AF8-ERR(sn-+AD4-gssd+AF8-dummy))
+AD4- +- return PTR+AF8-ERR(sn-+AD4-gssd+AF8-dummy)+ADs-
+AD4- +-
+AD4- dprintk(+ACI-RPC: sending pipefs MOUNT notification for net +ACU-p+ACU-s+AFw-n+ACI-,
+AD4- net, NET+AF8-NAME(net))+ADs-
+AD4- mutex+AF8-lock(+ACY-sn-+AD4-pipefs+AF8-sb+AF8-lock)+ADs-

--
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust+AEA-netapp.com
http://www.netapp.com