[CRIU] [PATCH] /dev/ptmx handling in zdtm tests

Filipe Brandenburger filbranden at google.com
Tue Aug 26 17:30:56 PDT 2014


Hi Andrey,

We have some machines without CONFIG_DEVPTS_MULTIPLE_INSTANCES set that started
failing zdtm tests recently, as some of the latest changes will use ptmx from
/dev/pts which is included in the newinstance /dev/pts.

This patch will try to detect whether /dev/pts/ptmx is available before using it.

The logic of creating /dev/ptmx from /dev/pts/ptmx was also a little weird, I
see that you were first creating a symlink, then mounting /dev/pts, then doing
a bind mount of /dev/pts/ptmx into /dev/ptmx but as /dev/ptmx was a symlink
itself then it was essentially bind mounting it over itself :-)

I tried to touch a file and bind mount it, but that caused ns/static/clean_mntns
to fail, so I just used the fallback of the symlink (which I made relative)
which made that test pass.

Please take a critical look at this one and make sure this is the correct
intention in the CONFIG_DEVPTS_MULTIPLE_INSTANCES=y case, and that you're OK to
fallback to the previous behavior if CONFIG_DEVPTS_MULTIPLE_INSTANCES=n, and
that you agree that checking for the presence of /dev/pts/ptmx is a good enough
way to detect that.

Cheers,
Filipe


Filipe Brandenburger (1):
  zdtm: fallback to mknod(/dev/ptmx) when
    CONFIG_DEVPTS_MULTIPLE_INSTANCES is not set

 test/zdtm/lib/ns.c | 25 +++++++++++++++++--------
 1 file changed, 17 insertions(+), 8 deletions(-)

-- 
1.9.3



More information about the CRIU mailing list