mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-20 01:54:28 +00:00
mount: remove root with MS_PRIVATE before cleaning up mntns
Otherwise we will clean up the root mntns too. Signed-off-by: Andrew Vagin <avagin@openvz.org> Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
parent
929a0f24fd
commit
f16d7c64e5
2 changed files with 9 additions and 0 deletions
5
mount.c
5
mount.c
|
|
@ -574,6 +574,11 @@ static int clean_mnt_ns(void)
|
|||
* Mountinfos were collected at prepare stage
|
||||
*/
|
||||
|
||||
if (mount("none", "/", "none", MS_REC|MS_PRIVATE, NULL)) {
|
||||
pr_perror("Can't remount root with MS_PRIVATE");
|
||||
return -1;
|
||||
}
|
||||
|
||||
pm = mnt_build_tree(mntinfo);
|
||||
if (!pm)
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,10 @@ static int test_fn(int argc, char **argv)
|
|||
int fd, tmpfs_fd;
|
||||
unsigned fs_cnt, fs_cnt_last = 0;
|
||||
|
||||
if (mount("none", "/", "none", MS_REC|MS_PRIVATE, NULL)) {
|
||||
err("Can't remount root with MS_PRIVATE");
|
||||
return -1;
|
||||
}
|
||||
again:
|
||||
fs_cnt = 0;
|
||||
f = fopen("/proc/self/mountinfo", "r");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue