linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: "Eric W.Biederman" <ebiederm@xmission.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC] dealing with proc_ns_follow_link() and "namespace" dentries
Date: Sat, 1 Nov 2014 22:04:58 +0000	[thread overview]
Message-ID: <20141101220458.GT7996@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20141101183802.GR7996@ZenIV.linux.org.uk>

On Sat, Nov 01, 2014 at 06:38:02PM +0000, Al Viro wrote:
> On Sat, Nov 01, 2014 at 11:23:34AM -0700, Eric W.Biederman wrote:
> 
> > >From your description I am concerned about using the letter combination nsfs.   I once used nsfd, and that was so close to nfsd that Linus got confused, and hilarity ensued.   nsfs isn't quite as bad but the abbreviation still seems close enough to nfs that confusion could result.
> 
> Well, yes, but... the only non-static object in there with "nsfs" in the
> name is nsfs_init().  As for the filename itself... any better suggestions
> would be welcome, but it doesn't really mess the completion tree.
> 
> I've no strong preferences here - we might even move it into kernel/nsproxy.c.
> In the latest variant it's ~160 lines...

BTW, as an immediate followup, definition of struct nameidata can be
taken to fs/namei.c now.  nd_get_link/nd_set_link become exported, actual
declaration of struct nameidata goes into fs/namei.c and for everything
outside of fs/namei.c it becomes completely opaque.

TBH, I'm somewhat tempted to do something even more extreme - try to treat
it the way we treat pt_regs.  I.e. have a pointer to such sucker in
task_struct (NULL most of the time) and chain the instances.  That way
we'd be rid of passing that sucker even to ->follow_link() (and to
nd_{set,get}_link() as well).  path_init() would push the sucker to the
top of the chain, path_finish(nd, base) (currently open-coded bunch of
        if (nd->root.mnt && !(nd->flags & LOOKUP_ROOT))
                path_put(&nd->root);
	if (base)
		fput(base);
) - remove it from the chain.  Not sure if it's worth doing - it's slightly
less boilerplate in ->follow_link() and ->put_link() instances and it _might_
reduce the stack footprint in a bunch of places in fs/namei.c (including the
recursion in there), but it might easily end up increasing it instead...

  reply	other threads:[~2014-11-01 22:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-13  6:29 [RFC] dealing with proc_ns_follow_link() and "namespace" dentries Al Viro
2014-10-13 22:42 ` Eric W. Biederman
2014-11-01  8:38   ` Al Viro
2014-11-01 15:06     ` Al Viro
2014-11-01 18:23       ` Eric W.Biederman
2014-11-01 18:38         ` Al Viro
2014-11-01 22:04           ` Al Viro [this message]
2014-11-01 18:30       ` Al Viro
2014-11-24 10:55         ` Al Viro
2014-10-14  0:41 ` Al Viro

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=20141101220458.GT7996@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=ebiederm@xmission.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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).