linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: "Myklebust, Trond" <Trond.Myklebust@netapp.com>
Cc: "chuck.lever@oracle.com" <chuck.lever@oracle.com>,
	"neilb@suse.de" <neilb@suse.de>,
	"steved@redhat.com" <steved@redhat.com>,
	"linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH v4 1/3] sunrpc: create a new dummy pipe for gssd to hold open
Date: Fri, 15 Nov 2013 12:48:58 -0500	[thread overview]
Message-ID: <20131115124858.1e3d2dd4@tlielax.poochiereds.net> (raw)
In-Reply-To: <1384534611.4046.8.camel@leira.trondhjem.org>

On Fri, 15 Nov 2013 16:56:51 +0000
"Myklebust, Trond" <Trond.Myklebust@netapp.com> wrote:

> On Thu, 2013-11-14 at 07:25 -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 "gssd" 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 <jlayton@redhat.com>
> 
> Hi Jeff,
> 
> Don't you need something in rpc_kill_sb() in order to remove the pipe
> and the clntXX directory?
> 
> Also please see rpc_mkdir_populate() and rpc_mkdir_depopulate() for how
> you can simplify the creation/destruction of the clntXX+clntXX/gssd.
> 
> Cheers
>   Trond

The concerned me too when I was working on this patch, but I don't think
that's the case. Note that rpc_kill_sb() doesn't call rpc_depopulate() or
anything for the top level directories in files[] either, which puzzled
me until I dove in to figure out why...

Basically what happens is that we take a dentry reference to those when
they are instantiated and that keeps them pinned in memory. The last
thing that rpc_kill_sb() does is call kill_litter_super(), which calls
d_gencode() to put a reference on any dentry reachable from s->root.

After that, it calls generic_shutdown_super() which then calls
shrink_dcache_for_umount() to go through and purge all of the
dentries that are now at 0. At that point you should see "Dentry ...
still in use" messages if any still have a non-zero refcount. I've
tested mounting and unmounting rpc_pipefs with this set and I've never
seen those warnings pop.

So, I don't think we need to do any cleanup of them, but I will admit
that none of this is particularly obvious. ;)

-- 
Jeff Layton <jlayton@redhat.com>

  reply	other threads:[~2013-11-15 17:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-14 12:25 [PATCH v4 0/3] sunrpc/nfs: more reliable detection of running gssd Jeff Layton
2013-11-14 12:25 ` [PATCH v4 1/3] sunrpc: create a new dummy pipe for gssd to hold open Jeff Layton
2013-11-15 16:56   ` Myklebust, Trond
2013-11-15 17:48     ` Jeff Layton [this message]
2013-11-14 12:25 ` [PATCH v4 2/3] sunrpc: replace sunrpc_net->gssd_running flag with a more reliable check Jeff Layton
2013-11-14 12:25 ` [PATCH v4 3/3] nfs: check if gssd is running before attempting to use krb5i auth in SETCLIENTID call 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=20131115124858.1e3d2dd4@tlielax.poochiereds.net \
    --to=jlayton@redhat.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=steved@redhat.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).