Commit 7281a665 authored by Andrey Vagin's avatar Andrey Vagin Committed by David S. Miller
Browse files

net: allow to kill a task which waits net_mutex in copy_new_ns

net_mutex can be locked for a long time. It may be because many
namespaces are being destroyed or many processes decide to create
a network namespace.

Both these operations are heavy, so it is better to have an ability to
kill a process which is waiting net_mutex.

Cc: "David S. Miller" <>
Cc: Eric W. Biederman <>
Signed-off-by: default avatarAndrei Vagin <>
Signed-off-by: default avatarDavid S. Miller <>
parent d65f2fa6
......@@ -379,7 +379,14 @@ struct net *copy_net_ns(unsigned long flags,
rv = mutex_lock_killable(&net_mutex);
if (rv < 0) {
return ERR_PTR(rv);
net->ucounts = ucounts;
rv = setup_net(net, user_ns);
if (rv == 0) {
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment