pid: make ENOMEM return value more obvious
The alloc_pid() codepath used to be simpler. With the introducation of the
ability to choose specific pids in 49cb2fc42ce4 ("fork: extend clone3() to
support setting a PID") it got more complex. It hasn't been super obvious
that ENOMEM is returned when the pid namespace init process/child subreaper
of the pid namespace has died. As can be seen from multiple attempts to
improve this see e.g.  and most recently .
We regressed returning ENOMEM in  and  restored it. Let's add a
comment on top explaining that this is historic and documented behavior and
cannot easily be changed.
: 35f71bc0a09a ("fork: report pid reservation failure properly")
: b26ebfe12f34 ("pid: Fix error return value in some cases")
: 49cb2fc42ce4 ("fork: extend clone3() to support setting a PID")
Signed-off-by: Christian Brauner <firstname.lastname@example.org>
1 file changed