Re: [PATCH v7 1/2] fork: extend clone3() to support setting a PID
From: Oleg Nesterov
Date: Mon Nov 11 2019 - 11:32:19 EST
On 11/11, Christian Brauner wrote:
>
> On Mon, Nov 11, 2019 at 04:40:28PM +0100, Adrian Reber wrote:
> > > note also that this way we can easily allow set_tid[some_level] == 0, we can
> > > simply do
> > >
> > > - if (xxx < 1 || xxx >= pid_max)
> > > + if (xxx < 0 || xxx >= pid_max)
> > >
> > > although I don't think this is really useful.
> >
> > Yes. I explicitly didn't allow 0 as a PID as I didn't thought it would
> > be useful (or maybe even valid).
>
> How do you express: I don't care about a specific pid in pidns level
> <n>,
Yes,
> Wouldn't that be potentially useful?
As I said above, I don't think this is really useful. Just I was thinking
out loud.
I suggested to cache set_tid[pos] rather than pos because this makes the
code simpler, not because this allows this allows to "naturally" handle
the case when set_tid[pos] == 0. Sorry it it was not clear.
Oleg.