lkml.org 
[lkml]   [2012]   [Oct]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] pidns: limit the nesting depth of pid namespaces
On Wed, 24 Oct 2012 09:38:57 +0400
Andrey Wagin <avagin@gmail.com> wrote:

> >
> > I think that returning -ENOMEM in response to an excessive nesting
> > attempt is misleading - the system *didn't* run out of memory. EINVAL
> > is better?
>
> I chose ENOMEM by analogy with max_pid. When a new PID can not be
> allocated, ENOMEM is returned too.

I don't know what this means - please be carefully specific when
identifying kernel code.

If you're referring to kernel/pid.c:alloc_pid() then -ENOMEM is
appropriate there, because a failure *is* caused by memory allocation
failure.

But ENOMEM isn't appropriate for nesting-depth-exceeded - we shouldn't
tell the user "you ran out of memory" when he didn't! -EINVAL isn't
really appropriate either ("Invalid argument") but it has become a
general you-screwed-up catchall and seems to me to be the most
appropriate errno we have available.



\
 
 \ /
  Last update: 2012-10-25 08:21    [W:0.077 / U:0.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site