[Devel] [PATCH RHEL9 COMMIT] pid_ns: Forgotten initialization of pid_max

Konstantin Khorenko khorenko at virtuozzo.com
Tue May 31 14:16:58 MSK 2022


The commit is pushed to "branch-rh9-5.14.0-70.13.1.vz9.16.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh9-5.14.0-70.13.1.vz9.16.2
------>
commit 1e0e04e7985fb276956d1c370ee51dcdc8978d7d
Author: Alexey Kuznetsov <kuznet at acronis.com>
Date:   Mon May 30 23:44:10 2022 +0800

    pid_ns: Forgotten initialization of pid_max
    
    Lesha's comment:
      How it boots for you, folks, it remains a puzzle which I have no time
      to solve.  For me it crashes systemd right in in initrd. It is kind of
      difficult to work without pids, is not it? :-)
    
    We forgot to initialize pid_max for init_pid_ns which is static and does
    not go through create_pid_namespace().
    
    Previously systemd (ver 249) checked pid_max and if 0 is detected, wrote
    TASK_MAX there.
    In RHEL9 systemd does not try to be smart and just fails to work.
    
    https://jira.sw.ru/browse/PSBM-140308
    Fixes: f6a7abc88764 ("pid_ns: Virtualize pid_max")
    
    Signed-off-by: Alexey Kuznetsov <kuznet at acronis.com>
    Acked-by: Konstantin Khorenko <khorenko at virtuozzo.com>
---
 kernel/pid.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/pid.c b/kernel/pid.c
index 29e21ccfdf0b..ebe115ce2a34 100644
--- a/kernel/pid.c
+++ b/kernel/pid.c
@@ -76,6 +76,7 @@ struct pid_namespace init_pid_ns = {
 	.ns.count = REFCOUNT_INIT(2),
 	.idr = IDR_INIT(init_pid_ns.idr),
 	.pid_allocated = PIDNS_ADDING,
+	.pid_max = PID_MAX_DEFAULT,
 	.level = 0,
 	.child_reaper = &init_task,
 	.user_ns = &init_user_ns,


More information about the Devel mailing list