mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "Serge E. Hallyn" <serue@us.ibm.com>
Cc: menage@google.com, dev@sw.ru, xemul@sw.ru, vatsa@in.ibm.com,
	ebiederm@xmission.com, haveblue@us.ibm.com,
	svaidy@linux.vnet.ibm.com, balbir@in.ibm.com, pj@sgi.com,
	cpw@sgi.com, ckrm-tech@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, containers@lists.osdl.org,
	mbligh@google.com, rohitseth@google.com, devel@openvz.org
Subject: Re: [PATCH 2/2] containers: implement namespace tracking subsystem (v3)
Date: Tue, 26 Jun 2007 14:58:36 -0700	[thread overview]
Message-ID: <20070626145836.638a01cf.akpm@linux-foundation.org> (raw)
In-Reply-To: <20070613230125.GA7519@sergelap.austin.ibm.com>

On Wed, 13 Jun 2007 18:01:25 -0500
"Serge E. Hallyn" <serue@us.ibm.com> wrote:

> @@ -177,6 +184,15 @@ int unshare_nsproxy_namespaces(unsigned long unshare_flags,
>  	if (IS_ERR(*new_nsp)) {
>  		err = PTR_ERR(*new_nsp);
>  		put_nsproxy(old_ns);
> +		goto out;
> +	}
> +
> +	err = ns_container_clone(current);
> +	if (err) {
> +		put_nsproxy(*new_nsp);
> +		put_nsproxy(old_ns);
>  	}
> +
> +out:
>  	return err;
>  }

I had to fix a reject here: the put_nsproxy(old_ns) has disappeared from
this code.

end result:

int unshare_nsproxy_namespaces(unsigned long unshare_flags,
		struct nsproxy **new_nsp, struct fs_struct *new_fs)
{
	int err = 0;

	if (!(unshare_flags & (CLONE_NEWNS | CLONE_NEWUTS | CLONE_NEWIPC |
			       CLONE_NEWUSER)))
		return 0;

	if (!capable(CAP_SYS_ADMIN))
		return -EPERM;

	*new_nsp = create_new_namespaces(unshare_flags, current,
				new_fs ? new_fs : current->fs);
	if (IS_ERR(*new_nsp))
		err = PTR_ERR(*new_nsp);
		goto out;
	}

	err = ns_container_clone(current);
	if (err)
		put_nsproxy(*new_nsp);

out:
	return err;
}


  reply	other threads:[~2007-06-26 22:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-13 22:56 [PATCH 1/2] containers: implement subsys->post_clone() Serge E. Hallyn
2007-06-13 23:01 ` [PATCH 2/2] containers: implement namespace tracking subsystem (v3) Serge E. Hallyn
2007-06-26 21:58   ` Andrew Morton [this message]
2007-06-26 22:51     ` Serge E. Hallyn
2007-06-13 23:08 ` [PATCH 1/2] containers: implement subsys->post_clone() Paul Jackson

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=20070626145836.638a01cf.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=balbir@in.ibm.com \
    --cc=ckrm-tech@lists.sourceforge.net \
    --cc=containers@lists.osdl.org \
    --cc=cpw@sgi.com \
    --cc=dev@sw.ru \
    --cc=devel@openvz.org \
    --cc=ebiederm@xmission.com \
    --cc=haveblue@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mbligh@google.com \
    --cc=menage@google.com \
    --cc=pj@sgi.com \
    --cc=rohitseth@google.com \
    --cc=serue@us.ibm.com \
    --cc=svaidy@linux.vnet.ibm.com \
    --cc=vatsa@in.ibm.com \
    --cc=xemul@sw.ru \
    /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

all inboxes | Powered by JetHome®