[PATCH v4 1/7] PID namespace translation support
Dmitry V. Levin
ldv at altlinux.org
Thu Jul 30 19:14:51 UTC 2020
On Thu, Jul 30, 2020 at 06:00:02PM +0200, Ákos Uzonyi wrote:
> On Thu, 30 Jul 2020 at 16:28, Dmitry V. Levin <ldv at altlinux.org> wrote:
> > On Mon, Jul 27, 2020 at 08:54:04PM +0200, Ákos Uzonyi wrote:
> [...]
> > > diff --git a/defs.h b/defs.h
> > > index 21f8775d..4df21700 100644
> > > --- a/defs.h
> > > +++ b/defs.h
> > > @@ -280,6 +280,9 @@ struct tcb {
> > > struct timespec etime; /* Syscall entry time (CLOCK_MONOTONIC) */
> > > struct timespec delay_expiration_time; /* When does the delay end */
> > >
> > > + uint64_t pid_ns;
> > > + bool pid_ns_inited;
> > > +
> > > struct mmap_cache_t *mmap_cache;
> > >
> > > /*
> >
> > Hmm, this adds a hole between pid_ns and mmap_cache fields on 64-bit systems.
> >
> > I wonder whether we need pid_ns_inited field at all. If I read the kernel
> > correctly, pid_ns is assigned from struct ns_common.inum of type unsigned int.
>
> I'm not sure how you suggest replacing the functionality of
> pid_ns_inited. It's there to distinguish the cases when pid_ns is not
> initialized, and when initialization is failed with an error (in both
> cases pid_ns is 0).
I suppose we could use any value which is not a valid
struct ns_common.inum value, e.g. -1ULL.
--
ldv
More information about the Strace-devel
mailing list