]> git.baikalelectronics.ru Git - kernel.git/commit
pid: make ENOMEM return value more obvious
authorChristian Brauner <christian.brauner@ubuntu.com>
Sun, 8 Mar 2020 13:29:17 +0000 (14:29 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 9 Mar 2020 22:40:05 +0000 (23:40 +0100)
commit85234fedd9f88e6b5985063916c2dfba3641c661
treeee081e195b02452ef768bbb26a7154a9f1292210
parentfd21fe2d2b429ab474ae2b5b2b3e583b7a8110a8
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 6b76c890a6f1 ("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. [1] and most recently [2].
We regressed returning ENOMEM in [3] and [2] restored it. Let's add a
comment on top explaining that this is historic and documented behavior and
cannot easily be changed.

[1]: f8cf9f38ee1d ("fork: report pid reservation failure properly")
[2]: fd21fe2d2b42 ("pid: Fix error return value in some cases")
[3]: 6b76c890a6f1 ("fork: extend clone3() to support setting a PID")
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
kernel/pid.c