* Re: + fork-unshare-remove-dead-code.patch added to -mm tree
@ 2012-10-31 14:37 Oleg Nesterov
0 siblings, 0 replies; only message in thread
From: Oleg Nesterov @ 2012-10-31 14:37 UTC (permalink / raw)
To: Alan Cox, Andrew Morton; +Cc: linux-kernel
> --- 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.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-10-31 14:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-31 14:37 + fork-unshare-remove-dead-code.patch added to -mm tree Oleg Nesterov
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).