All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Trond Myklebust <trond.myklebust@primarydata.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
	Devel FS Linux <linux-fsdevel@vger.kernel.org>,
	Torvalds Linus <torvalds@linux-foundation.org>,
	Eric Biederman <ebiederm@xmission.com>
Subject: Re: [PATCH 00/11] [RFC] repair net namespace damage to rpc_pipefs
Date: Mon, 2 Dec 2013 15:57:22 +0000	[thread overview]
Message-ID: <20131202155722.GE10323@ZenIV.linux.org.uk> (raw)
In-Reply-To: <3C65EB4C-6592-44F8-B08D-E5A9EFD6C8C6@primarydata.com>

On Mon, Dec 02, 2013 at 08:44:25AM -0500, Trond Myklebust wrote:

> > I'll have to let the net namespace folks chime in for that, as far as
> > I'm concerned it's a featured better config'ed off.  If they can't come
> > up with anything better the procfs hack above would be it.
> 
> The lifetime of the kernel mount only needs to match that of the rpc_client, since each rpc_client is associated to a single net namespace, and each net namespace is in a 1-1 relationship with an rpc_pipefs super block.
> 
> IOW: move the kernel mount/umount back to the rpc_client create/destroy methods and all should be well.

Hmm...  I'm looking through rpc_pipe.c and there are some fun issues in there:
	* ->kill_sb() *is* called after rpc_fill_super() failures.  It's
not ->put_super() (and even ->put_super() would've been called for failures
past setting ->s_root).  With ->s_fs_info set only on success, it means
that rpc_kill_sb() will just oops after such failure exits.
	* just what is
        if (sn->pipefs_sb != sb) {
                mutex_unlock(&sn->pipefs_sb_lock);
                goto out;
        }
        sn->pipefs_sb = NULL;
about?  In which scenario is it not equal to ->pipefs_sb?  When said
->pipefs_sb is NULL?  But that, AFAICS, can happen only on cleanup after
failing rpc_fill_super(), in which case we won't get that sn thing in
the first place (in fact, we'll oops trying to get it).

Trond, am I right interpreting you as "that filesystem has non-empty
contents only when there is at least one rpc_client in that netns;
after rpc_client removal there won't be any accesses to data structures
associated with it (due to rpc_close_pipes() and friends, presumably),
so there won't be any need to keep netns alive after that"?

If so and if rpc_client really can't outlive netns, then yes, having each 
of them hold an internal vfsmount reference pinning rpc_pipefs down would
suffice.

WARNING: multiple messages have this Message-ID (diff)
From: Al Viro <viro-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
To: Trond Myklebust
	<trond.myklebust-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org>
Cc: Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>,
	Linux NFS Mailing List
	<linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Devel FS Linux
	<linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Torvalds Linus
	<torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
	Eric Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH 00/11] [RFC] repair net namespace damage to rpc_pipefs
Date: Mon, 2 Dec 2013 15:57:22 +0000	[thread overview]
Message-ID: <20131202155722.GE10323@ZenIV.linux.org.uk> (raw)
In-Reply-To: <3C65EB4C-6592-44F8-B08D-E5A9EFD6C8C6-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org>

On Mon, Dec 02, 2013 at 08:44:25AM -0500, Trond Myklebust wrote:

> > I'll have to let the net namespace folks chime in for that, as far as
> > I'm concerned it's a featured better config'ed off.  If they can't come
> > up with anything better the procfs hack above would be it.
> 
> The lifetime of the kernel mount only needs to match that of the rpc_client, since each rpc_client is associated to a single net namespace, and each net namespace is in a 1-1 relationship with an rpc_pipefs super block.
> 
> IOW: move the kernel mount/umount back to the rpc_client create/destroy methods and all should be well.

Hmm...  I'm looking through rpc_pipe.c and there are some fun issues in there:
	* ->kill_sb() *is* called after rpc_fill_super() failures.  It's
not ->put_super() (and even ->put_super() would've been called for failures
past setting ->s_root).  With ->s_fs_info set only on success, it means
that rpc_kill_sb() will just oops after such failure exits.
	* just what is
        if (sn->pipefs_sb != sb) {
                mutex_unlock(&sn->pipefs_sb_lock);
                goto out;
        }
        sn->pipefs_sb = NULL;
about?  In which scenario is it not equal to ->pipefs_sb?  When said
->pipefs_sb is NULL?  But that, AFAICS, can happen only on cleanup after
failing rpc_fill_super(), in which case we won't get that sn thing in
the first place (in fact, we'll oops trying to get it).

Trond, am I right interpreting you as "that filesystem has non-empty
contents only when there is at least one rpc_client in that netns;
after rpc_client removal there won't be any accesses to data structures
associated with it (due to rpc_close_pipes() and friends, presumably),
so there won't be any need to keep netns alive after that"?

If so and if rpc_client really can't outlive netns, then yes, having each 
of them hold an internal vfsmount reference pinning rpc_pipefs down would
suffice.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2013-12-02 15:57 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-01 13:14 [PATCH 00/11] [RFC] repair net namespace damage to rpc_pipefs Christoph Hellwig
2013-12-01 13:14 ` [PATCH 01/11] sunrpc: allocate pipefs inodes using kmalloc Christoph Hellwig
2013-12-01 13:14   ` Christoph Hellwig
2013-12-01 14:26   ` Jeff Layton
2013-12-01 14:26     ` Jeff Layton
2013-12-01 13:14 ` [PATCH 02/11] rpc_pipefs: always mount on net namespace initialization Christoph Hellwig
2013-12-01 13:14   ` Christoph Hellwig
2013-12-01 15:24   ` Jeff Layton
2013-12-01 13:14 ` [PATCH 03/11] sunrpc: remove the rpc_clients_block notifier Christoph Hellwig
2013-12-01 13:14   ` Christoph Hellwig
2013-12-01 15:25   ` Jeff Layton
2013-12-01 13:14 ` [PATCH 04/11] sunrpc: no need to have a lock or superblock for rpc_unlink Christoph Hellwig
2013-12-01 13:14   ` Christoph Hellwig
2013-12-01 13:14 ` [PATCH 05/11] sunprc: add sensible pipe creation and removal helpers Christoph Hellwig
2013-12-01 13:14   ` Christoph Hellwig
2013-12-01 13:14 ` [PATCH 06/11] sunrpc: clean up rpc_pipefs client dir creation Christoph Hellwig
2013-12-01 13:14   ` Christoph Hellwig
2013-12-01 13:14 ` [PATCH 07/11] sunrpc: make rpc_mkdir_populate net-namespace aware Christoph Hellwig
2013-12-01 13:14   ` Christoph Hellwig
2013-12-01 13:14 ` [PATCH 08/11] sunrpc: rpc_get_sb_net, die, die, die Christoph Hellwig
2013-12-01 13:14   ` Christoph Hellwig
2013-12-01 13:14 ` [PATCH 09/11] nfs: convert idmapper to rpc_mkpipe_clnt Christoph Hellwig
2013-12-01 13:14   ` Christoph Hellwig
2013-12-01 13:14 ` [PATCH 10/11] auth_gss: convert " Christoph Hellwig
2013-12-01 13:14   ` Christoph Hellwig
2013-12-01 13:14 ` [PATCH 11/11] sunrpc: rpc_pipefs cleanup Christoph Hellwig
2013-12-01 13:14   ` Christoph Hellwig
2013-12-01 14:36 ` [PATCH 00/11] [RFC] repair net namespace damage to rpc_pipefs Jeff Layton
2013-12-01 14:36   ` Jeff Layton
2013-12-01 15:44 ` Jeff Layton
2013-12-01 15:44   ` Jeff Layton
2013-12-01 15:57   ` Jeff Layton
2013-12-01 18:13 ` Al Viro
2013-12-01 18:13   ` Al Viro
2013-12-02  8:12   ` Christoph Hellwig
2013-12-02  8:12     ` Christoph Hellwig
2013-12-02 13:44     ` Trond Myklebust
2013-12-02 14:24       ` Stanislav Kinsbursky
2013-12-02 14:24         ` Stanislav Kinsbursky
2013-12-02 15:36         ` Christoph Hellwig
2013-12-02 15:36           ` Christoph Hellwig
2013-12-02 15:58         ` Trond Myklebust
2013-12-02 15:58           ` Trond Myklebust
2013-12-03  7:24           ` Stanislav Kinsbursky
2013-12-03  7:24             ` Stanislav Kinsbursky
2013-12-02 15:34       ` Christoph Hellwig
2013-12-02 15:34         ` Christoph Hellwig
2013-12-02 16:00         ` Trond Myklebust
2013-12-02 16:00           ` Trond Myklebust
2013-12-02 16:27           ` Christoph Hellwig
2013-12-02 16:27             ` Christoph Hellwig
2013-12-02 16:46             ` Trond Myklebust
2013-12-02 16:46               ` Trond Myklebust
2013-12-02 16:33           ` Jeff Layton
2013-12-02 16:37             ` J. Bruce Fields
2013-12-02 16:45               ` Jeff Layton
2013-12-02 15:57       ` Al Viro [this message]
2013-12-02 15:57         ` Al Viro
2013-12-02 16:04         ` Trond Myklebust
2013-12-02 16:04           ` Trond Myklebust
2013-12-03  2:11   ` [RFC] alloc_pid() breakage Al Viro
2013-12-03  2:11     ` Al Viro
2013-12-02  7:23 ` [PATCH 00/11] [RFC] repair net namespace damage to rpc_pipefs Stanislav Kinsbursky
2013-12-02  7:23   ` Stanislav Kinsbursky

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=20131202155722.GE10323@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=ebiederm@xmission.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=trond.myklebust@primarydata.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.