All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Alan Cox <alan@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: + fork-unshare-remove-dead-code.patch added to -mm tree
Date: Wed, 31 Oct 2012 15:37:00 +0100	[thread overview]
Message-ID: <20121031143700.GA4094@redhat.com> (raw)

> --- a/kernel/fork.c~fork-unshare-remove-dead-code
> +++ a/kernel/fork.c
> @@ -1792,10 +1792,8 @@ SYSCALL_DEFINE1(unshare, unsigned long,
>  			exit_sem(current);
>  		}
>
> -		if (new_nsproxy) {
> +		if (new_nsproxy)
>  			switch_task_namespaces(current, new_nsproxy);
> -			new_nsproxy = NULL;
> -		}
>
>  		task_lock(current);
>
> @@ -1819,9 +1817,6 @@ SYSCALL_DEFINE1(unshare, unsigned long,
>  		task_unlock(current);
>  	}
>
> -	if (new_nsproxy)
> -		put_nsproxy(new_nsproxy);
> -

Agreed.

Perhaps it also makes sense to kill
"if (new_fs || new_fd || do_sysvsem || new_nsproxy)" ? This check
buys nothing. And without this check it is obvious why we do not
need put_nsproxy() after this block.

Oleg.


             reply	other threads:[~2012-10-31 14:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-31 14:37 Oleg Nesterov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-10-30 23:08 + fork-unshare-remove-dead-code.patch added to -mm tree akpm

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=20121031143700.GA4094@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=alan@linux.intel.com \
    --cc=linux-kernel@vger.kernel.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.