From: Oleg Nesterov <oleg-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Michael Kerrisk
<mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Ulrich Drepper <drepper-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH 1/1][V3] Add reboot_pid_ns to handle the reboot syscall
Date: Wed, 7 Dec 2011 16:12:35 +0100 [thread overview]
Message-ID: <20111207151235.GA21962@redhat.com> (raw)
In-Reply-To: <20111206171617.e31bc3a6.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
On 12/06, Andrew Morton wrote:
> On Sun, 4 Dec 2011 21:24:50 +0100
> Daniel Lezcano <daniel.lezcano-GANU6spQydw@public.gmane.org> wrote:
>
> > This patch propose to store the reboot value in the 16 upper bits of the
> > exit code from the processes belonging to a pid namespace which has
> > rebooted. When the reboot syscall is called and we are not in the initial
> > pid namespace, we kill the pid namespace.
> >
> > By this way the parent process of the child pid namespace to know if
> > it rebooted or not and take the right decision.
>
> hm, modifying the exit code in this manner is a strange interface. I
> didn't see that coming. Perhaps some additional justification for this
> idea should be added to the changelog, along with discussion of
> alternative schemes. I don't immediately see any problems with it,
> but, odd... I wonder what potential it has to upset existing
> userspace.
Alternatively, we could do something like
switch (reboot) {
case LINUX_REBOOT_CMD_RESTART:
exit_code = SIGHUP;
break;
case LINUX_REBOOT_CMD_HALT:
exit_code = SIGINT;
break;
...
}
this way the parent can check WIFSIGNALED/WTERMSIG instead of upper bits.
This was the initial suggestion, and personally I like this more.
But I do not think this can upset existing userspace. __WEXITSTATUS()
reports the lower bits only, it can't see the extra info we add.
> Also, this affects the data delivered by taskstats, I believe. Please
> check this, test it, document it in the changelog and update
> getdelays.c appropriately.
No, taskstats report ->exit_code. This doesn't look right btw. But
in any case I do not think this can break something.
> Also, glibc might be affected. For symmetry we might want to add a
> WIFREBOOT() or something.
We already use these upper bits to report the ptrace events, in the
same manner. I do not think this has something to do with libc.
Although it could probably have another macro to read this info.
> And we now expect waitid() to fill in extra
> bits in siginfo_t.si_status, which assumes that glibc (and other
> libc's!) aren't using a u8 in there somewhere. etcetera. This all
> should be tested, and reviewed by Uli (please).
Again, ptrace already puts the extra info this way when the tracee
stops.
Oleg.
next prev parent reply other threads:[~2011-12-07 15:12 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-04 20:24 [PATCH 0/1][V3] Handle reboot in a child pid namespace Daniel Lezcano
[not found] ` <1323030290-22216-1-git-send-email-daniel.lezcano-GANU6spQydw@public.gmane.org>
2011-12-04 20:24 ` [PATCH 1/1][V3] Add reboot_pid_ns to handle the reboot syscall Daniel Lezcano
[not found] ` <1323030290-22216-2-git-send-email-daniel.lezcano-GANU6spQydw@public.gmane.org>
2011-12-05 18:35 ` Serge Hallyn
2011-12-05 20:42 ` Oleg Nesterov
[not found] ` <20111205204238.GA7422-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-12-05 21:16 ` Daniel Lezcano
2011-12-05 21:17 ` Daniel Lezcano
2011-12-07 1:16 ` Andrew Morton
[not found] ` <20111206171617.e31bc3a6.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2011-12-07 15:12 ` Oleg Nesterov [this message]
2011-12-07 21:36 ` Daniel Lezcano
2011-12-04 21:27 ` [PATCH 0/1][V3] Handle reboot in a child pid namespace Henrique de Moraes Holschuh
[not found] ` <20111204212756.GB16362@khazad-dum.debian.net>
[not found] ` <20111204212756.GB16362-ZGHd14iZgfaRjzvQDGKj+xxZW9W5cXbT@public.gmane.org>
2011-12-04 23:08 ` Daniel Lezcano
[not found] ` <4EDBFD67.1040009-GANU6spQydw@public.gmane.org>
2011-12-05 20:49 ` Daniel Lezcano
[not found] ` <4EDD2E5C.1050107-GANU6spQydw@public.gmane.org>
2011-12-05 20:51 ` Oleg Nesterov
2011-12-05 20:50 ` Oleg Nesterov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111207151235.GA21962@redhat.com \
--to=oleg-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=drepper-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox