From 6f45c38c18f92638bfb50e24e02f3c68f364095d Mon Sep 17 00:00:00 2001 From: Andrey Vagin Date: Wed, 25 Jun 2014 12:36:43 +0400 Subject: [PATCH] mount: parse devpts options The newinstance options isn't shown in mountinfo. Currently it is detected in devpts_dump. It is added only for root mounts and it isn't added for bind-mounts. So mounts_equal(a, b, true) returns false for such mounts and criu doesn't understand that they should be bind-mounted. Reported-by: Tycho Andersen Cc: Serge Hallyn Signed-off-by: Andrey Vagin Acked-by: Serge E. Hallyn Signed-off-by: Pavel Emelyanov --- mount.c | 4 ++-- test/zdtm/lib/ns.c | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mount.c b/mount.c index 1793c20ef..4d84f48df 100644 --- a/mount.c +++ b/mount.c @@ -672,7 +672,7 @@ static int attach_option(struct mount_info *pm, char *opt) } /* Is it mounted w or w/o the newinstance option */ -static int devpts_dump(struct mount_info *pm) +static int devpts_parse(struct mount_info *pm) { struct stat *host_st; @@ -839,7 +839,7 @@ static struct fstype fstypes[] = { .restore = tmpfs_restore, }, { .name = "devpts", - .dump = devpts_dump, + .parse = devpts_parse, .code = FSTYPE__DEVPTS, }, { .name = "simfs", diff --git a/test/zdtm/lib/ns.c b/test/zdtm/lib/ns.c index a2167151f..8afec5bdf 100644 --- a/test/zdtm/lib/ns.c +++ b/test/zdtm/lib/ns.c @@ -81,6 +81,10 @@ static int prepare_mntns() fprintf(stderr, "mount(/dev/pts) failed: %m\n"); return -1; } + if (mount("/dev/pts/ptmx", "/dev/ptmx", NULL, MS_BIND, NULL)) { + fprintf(stderr, "mount(/dev/pts) failed: %m\n"); + return -1; + } if (fchdir(dfd)) { fprintf(stderr, "fchdir() failed: %m\n"); return -1;