summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorEric W. Biederman2016-09-22 20:08:36 +0200
committerEric W. Biederman2016-09-22 20:25:56 +0200
commitdf75e7748bae1c7098bfa358485389b897f71305 (patch)
tree90b7cdeced0ec6fd9a1543826a5850611c441671 /net
parentuserns; Document per user per user namespace limits. (diff)
downloadkernel-qcow2-linux-df75e7748bae1c7098bfa358485389b897f71305.tar.gz
kernel-qcow2-linux-df75e7748bae1c7098bfa358485389b897f71305.tar.xz
kernel-qcow2-linux-df75e7748bae1c7098bfa358485389b897f71305.zip
userns: When the per user per user namespace limit is reached return ENOSPC
The current error codes returned when a the per user per user namespace limit are hit (EINVAL, EUSERS, and ENFILE) are wrong. I asked for advice on linux-api and it we made clear that those were the wrong error code, but a correct effor code was not suggested. The best general error code I have found for hitting a resource limit is ENOSPC. It is not perfect but as it is unambiguous it will serve until someone comes up with a better error code. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'net')
-rw-r--r--net/core/net_namespace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 3e2812aeceb7..06af5d6a883c 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -370,7 +370,7 @@ struct net *copy_net_ns(unsigned long flags,
ucounts = inc_net_namespaces(user_ns);
if (!ucounts)
- return ERR_PTR(-ENFILE);
+ return ERR_PTR(-ENOSPC);
net = net_alloc();
if (!net) {