Commit 15a457bd authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

zdtm: Mark all mounts as private with one call

Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 07216269
...@@ -77,6 +77,11 @@ again: ...@@ -77,6 +77,11 @@ again:
return -1; return -1;
} }
if (mount(NULL, "/", NULL, MS_REC|MS_PRIVATE, NULL)) {
err("Can't remount / with MS_PRIVATE");
return -1;
}
while (fgets(buf, sizeof(buf), f) != NULL) { while (fgets(buf, sizeof(buf), f) != NULL) {
char *mp = buf, *end; char *mp = buf, *end;
...@@ -87,21 +92,14 @@ again: ...@@ -87,21 +92,14 @@ again:
end = strchr(mp, ' '); end = strchr(mp, ' ');
*end = '\0'; *end = '\0';
if (private) { if (!strcmp(mp, "/"))
if (!strcmp(mp, "/")) continue;
continue; if (!strcmp(mp, "/proc"))
if (!strcmp(mp, "/proc")) continue;
continue;
if (umount(mp))
if (umount(mp)) test_msg("umount(`%s') failed: %m\n", mp);
test_msg("umount(`%s') failed: %m\n", mp);
} else {
/* mount --make-rprivate / */
if (mount("none", mp, "none", MS_REC|MS_PRIVATE, NULL)) {
err("Can't remount %s with MS_PRIVATE", mp);
return -1;
}
}
fs_cnt++; fs_cnt++;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment