• Laurent Dufour's avatar
    pstree: bump kernel pid_max value if needed · 42cc04fc
    Laurent Dufour authored
    When restoring on a different node, it may happen that pid_max is
    below one of the pid we wanted to recreate.
    This leads to a restore error when cloning the restarted process:
    
    (00.011172) Forking task with 44794 pid (flags 0x0)
    (00.011205) Error (cr-restore.c:1008): 44794: Write 44793 to sys/kernel/ns_last_pid: Invalid argument
    
    This patch computes the largest pid value and sets the kernel pid_max if
    necessary.
    
    If the user don't have the permission to do so, the restart is
    failing mentioning that we can't push the pid_max limit.
    Signed-off-by: 's avatarLaurent Dufour <ldufour@linux.vnet.ibm.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    42cc04fc
pstree.c 22.1 KB