Skip to contentSkip to conversation

+ fork-unshare-remove-dead-code.patch added to -mm tree

DISCUSSION Oleg Nesterov 1 participant 1 message Oct 31, 2012

lore
Share & tools
lore
#0 lore raw
Quoted 15 lines
kernel/fork.c renamed from kernel/fork.c~fork-unshare-remove-dead-code +1 -3
@@ -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);
 

kernel/fork.c SYSCALL_DEFINE1(unshare, unsigned long, · line 1824

Quoted 6 lines
kernel/fork.c renamed from kernel/fork.c~fork-unshare-remove-dead-code +0 -3
@@ -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.