Re: [PATCH v4 1/3] sunrpc: create a new dummy pipe for gssd to hold open

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 15 Nov 2013 16:56:51 +0000
"Myklebust, Trond" <Trond.Myklebust@xxxxxxxxxx> 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@xxxxxxxxxx>
> 
> 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@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux