All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org (Eric W. Biederman)
To: Cedric Le Goater <clg-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
Cc: kyle-hoO6YkzgTuCM0SS3m2neIg@public.gmane.org,
	Dave Hansen <dave-gkUM19QKKo4@public.gmane.org>,
	bastian-yyjItF7Rl6lg9hUCZPvPmw@public.gmane.org,
	"H. Peter Anvin" <hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>,
	containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org,
	alan-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org,
	xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org
Subject: Re: [RFC][PATCH 0/8][v2]: Enable multiple mounts of devpts
Date: Tue, 02 Sep 2008 02:22:34 -0700	[thread overview]
Message-ID: <m1d4jmhpgl.fsf@frodo.ebiederm.org> (raw)
In-Reply-To: <48B7BB3C.5080404-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org> (Cedric Le Goater's message of "Fri, 29 Aug 2008 11:02:52 +0200")

Cedric Le Goater <clg-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org> writes:
> Hello Eric,
>
> I've spent some time on the code and I'm facing some issues with the nsproxy 
> API if we are to keep the mqueue namespace in nsproxy: 
>
> 	int copy_namespaces(unsigned long flags, struct task_struct *tsk);
> 	void exit_task_namespaces(struct task_struct *tsk);
> 	void switch_task_namespaces(struct task_struct *tsk, struct nsproxy
> *new);
> 	void free_nsproxy(struct nsproxy *ns);
> 	int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **,
> 		struct fs_struct *);
>
> nsproxy designed to work closely with the clone flags and it is not well
> suited to be called elsewhere than clone/unshare.

Right.

> So I could either : 
>
> (1) make a special case for the mqueue namespace and duplicate some code 
>     to unshare it from ->get_sb() when the option 'newinstance' is used.

This is probably the best option. 

You should be able to just wrap create_new_namespaces(flags=0,...)
to create a new one.

And then actually perform the unshare.

Which means in practice you will bump the ref count on
mq_ns and then drop it and insert a new mq_ns pointer but overall
that shouldn't be too bad.

> (2) to avoid duplicating code, use a clone_flags to unshare the mqueue 
>     namespace from ->get_sb() when the option 'newinstance' is used. that 
>     sounds silly because we might as well use sys_unshare() in that case.

We should be able to refactor the code so we don't have lots of
duplication.

> (3) move mq_ns out of nsproxy.  where shall I put it then ? 
>
>     (3.1) task_struct ? 
That is almost interesting.

>     (3.2) mnt namespace maybe ?
>

> BTW, have you taken a look at what dave resent in July ? 

I took a quick look.

> 	https://lists.linux-foundation.org/pipermail/containers/2008-July/011776.html
>
> This is the mqueue namespace patchset using CLONE_NEWIPC to unshare.
>  
> I wonder if there are arguments against that approach. I might have 
> forgotten some of the issues with unshare as I haven't looked at the 
> code for some time.

I don't know that there are any big issues.  But there is a
certain purity in saying the mq namespaces is it's own weird
global namespace that isn't connected to anything else.  Which
unfortunately happens to be the truth.

Eric

  parent reply	other threads:[~2008-09-02  9:22 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-21  2:21 [RFC][PATCH 0/8][v2]: Enable multiple mounts of devpts sukadev-r/Jw6+rmf7HQT0dZR+AlfA
     [not found] ` <20080821022126.GA29449-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-08-21  2:26   ` [RFC][PATCH 1/8]: /dev/tty tweak in init_dev() sukadev-r/Jw6+rmf7HQT0dZR+AlfA
     [not found]     ` <20080821022621.GA29658-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-08-21  9:19       ` Alan Cox
2008-08-21  9:26       ` Alan Cox
2008-08-21  2:26   ` [RFC][PATCH 2/8]: Add inode parameter devpts interfaces sukadev-r/Jw6+rmf7HQT0dZR+AlfA
2008-08-21  2:27   ` [RFC][PATCH 3/8]: Remove devpts_root global sukadev-r/Jw6+rmf7HQT0dZR+AlfA
2008-08-21  2:27   ` [RFC][PATCH 4/8]: Per-mount allocated_ptys sukadev-r/Jw6+rmf7HQT0dZR+AlfA
2008-08-21  2:28   ` [RFC][PATCH 5/8]: Per-mount 'config' object sukadev-r/Jw6+rmf7HQT0dZR+AlfA
2008-08-21  2:28   ` [RFC][PATCH 6/8]: Extract option parsing to new function sukadev-r/Jw6+rmf7HQT0dZR+AlfA
2008-08-21  2:29   ` [RFC][PATCH 7/8]: Auto-create ptmx node when mounting devpts sukadev-r/Jw6+rmf7HQT0dZR+AlfA
     [not found]     ` <20080821022908.GG29658-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-08-21  9:21       ` Alan Cox
     [not found]         ` <20080821102139.43c44f67-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2008-08-21 16:09           ` H. Peter Anvin
     [not found]             ` <48AD932F.8090908-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2008-08-21 16:27               ` Alan Cox
     [not found]                 ` <20080821172700.781b0011-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>
2008-08-21 16:49                   ` H. Peter Anvin
     [not found]                     ` <48AD9C93.6080302-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2008-08-21 17:22                       ` Serge E. Hallyn
     [not found]                         ` <20080821172245.GA28411-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-08-21 17:07                           ` Alan Cox
2008-08-21 17:23                       ` sukadev-r/Jw6+rmf7HQT0dZR+AlfA
     [not found]                         ` <20080821172342.GA8059-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-08-21 17:38                           ` Eric W. Biederman
     [not found]                             ` <m18wuqtgj7.fsf-B27657KtZYmhTnVgQlOflh2eb7JE58TQ@public.gmane.org>
2008-08-21 17:50                               ` H. Peter Anvin
     [not found]                                 ` <48ADAAE2.6040700-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2008-08-21 18:23                                   ` Eric W. Biederman
     [not found]                                     ` <m1hc9eqlbo.fsf-B27657KtZYmhTnVgQlOflh2eb7JE58TQ@public.gmane.org>
2008-08-21 18:36                                       ` H. Peter Anvin
2008-08-21 17:40                           ` H. Peter Anvin
     [not found]                             ` <48ADA890.4060309-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2008-08-21 18:11                               ` sukadev-r/Jw6+rmf7HQT0dZR+AlfA
     [not found]                                 ` <20080821181133.GB8059-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-08-21 18:17                                   ` H. Peter Anvin
2008-08-21 21:00                                   ` Serge E. Hallyn
     [not found]                                     ` <20080821210040.GA14532-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-08-21 22:16                                       ` sukadev-r/Jw6+rmf7HQT0dZR+AlfA
2008-08-21  2:29   ` [RFC][PATCH 8/8]: Enable multiple mounts of devpts sukadev-r/Jw6+rmf7HQT0dZR+AlfA
2008-08-21  2:45   ` [RFC][PATCH 0/8][v2]: " H. Peter Anvin
     [not found]     ` <48ACD6CB.5030706-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2008-08-21  3:10       ` sukadev-r/Jw6+rmf7HQT0dZR+AlfA
     [not found]         ` <20080821031028.GB30205-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-08-21  3:15           ` H. Peter Anvin
     [not found]             ` <48ACDDC7.3000704-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2008-08-21 16:34               ` Cedric Le Goater
     [not found]                 ` <48AD991F.9010906-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2008-08-21 16:40                   ` H. Peter Anvin
     [not found]                     ` <48AD9A97.6000807-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2008-08-21 16:54                       ` Cedric Le Goater
     [not found]                         ` <48AD9DCD.3060306-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2008-08-21 16:56                           ` H. Peter Anvin
2008-08-21 17:28                           ` Serge E. Hallyn
2008-08-21 17:45                           ` Eric W. Biederman
     [not found]                             ` <m1fxoys1ng.fsf-B27657KtZYmhTnVgQlOflh2eb7JE58TQ@public.gmane.org>
2008-08-21 21:02                               ` Cedric Le Goater
     [not found]                                 ` <48ADD7D3.7080400-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2008-08-29  9:02                                   ` Cedric Le Goater
     [not found]                                     ` <48B7BB3C.5080404-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2008-09-02  3:04                                       ` Serge E. Hallyn
     [not found]                                         ` <20080902030426.GB12277-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-09-02 10:00                                           ` Eric W. Biederman
     [not found]                                             ` <m1vdxeeuk0.fsf-B27657KtZYmhTnVgQlOflh2eb7JE58TQ@public.gmane.org>
2008-09-02 15:52                                               ` Serge E. Hallyn
     [not found]                                                 ` <20080902155211.GF8524-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-09-03 12:01                                                   ` Cedric Le Goater
     [not found]                                                     ` <48BE7C98.1040004-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2008-09-03 13:12                                                       ` Eric W. Biederman
2008-09-03 13:41                                                       ` Serge E. Hallyn
2008-09-03 11:47                                               ` Cedric Le Goater
     [not found]                                                 ` <48BE7959.1080109-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2008-09-03 13:24                                                   ` Serge E. Hallyn
2008-09-03 11:43                                           ` Cedric Le Goater
     [not found]                                             ` <48BE7845.6070500-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org>
2008-09-03 13:23                                               ` Serge E. Hallyn
     [not found]                                                 ` <20080903132307.GA9527-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2008-09-03 13:52                                                   ` Cedric Le Goater
2008-09-02  9:22                                       ` Eric W. Biederman [this message]
     [not found]                                         ` <m1d4jmhpgl.fsf-B27657KtZYmhTnVgQlOflh2eb7JE58TQ@public.gmane.org>
2008-09-03 12:04                                           ` Cedric Le Goater

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=m1d4jmhpgl.fsf@frodo.ebiederm.org \
    --to=ebiederm-as9lmozglivwk0htik3j/w@public.gmane.org \
    --cc=alan-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org \
    --cc=bastian-yyjItF7Rl6lg9hUCZPvPmw@public.gmane.org \
    --cc=clg-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org \
    --cc=containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org \
    --cc=dave-gkUM19QKKo4@public.gmane.org \
    --cc=hpa-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org \
    --cc=kyle-hoO6YkzgTuCM0SS3m2neIg@public.gmane.org \
    --cc=xemul-GEFAQzZX7r8dnm+yROfE0A@public.gmane.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 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.