- 21 Apr, 2014 36 commits
-
-
Andrey Vagin authored
This patch removes the global mntinfo_tree and collect_mount_info where it was constructed. The mntinfo list is filled from dump_mnt_ns, rst_collect_local_mntns, collect_mnt_namespaces and read_mnt_ns_img. A mountinfo entry contains a reference on a proper ns_id entry, so we cau use mnt_id to look up a proper mount namespace. v2: remove trash after rebasing. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
On restore all namespaces are restored as one tree and a pointer on the root of this tree will be set on each namespace. Below you can find a call trace, where it's used: Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
It's a typo fix. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Kernels before 3.15 doesn't show mnt_id and mnt_id isn't saved in images, if mntns isn't dumped. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
They are used for collecting unix sockets Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
We are going to dump nested mount namespaces, so we move the mountinfo list on the namespace structure. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
On restore all mount namespaces are restored in the root mntns and sub-namecpeaces are restored in temorary places. This function allows to get paths to these places. It will be used in open_remap_ghost(), because it's called in the root task, when other tasks are not forked yet. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
We are going to support nested mount namespaces, file descriptors can be from different namespaces, so a namespace root must be updated for each of them. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
We want to look up mntns by mnt_id. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
It's required for restoring in the current mntns. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
We are going to support nested mntns, so the global mntinfo_tree variable are useless and information about tree should be connected to a proper namespace. But when we don't dump mntns, we need to collect mounts for the current mntns. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
It will fill mntinfo list and this is internal logic of mount.c Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
We are going to support nested mount namespaces and each NS has own tree. The mount tree is used for checking that a file is reachable. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
We are going to support nested mount namespaces, so files can be opened from more than one namespace and a root must be collect for each file. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
mntns_collect_root() uses PROC_FD_OFF, so we need to close it. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
One device can be mounted a few times, so files are identical only, if they have the same mnt_id. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Otherwise it will have external files (from another namespace, which isn't dumped). Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
because we want to check, that all files are reachable. For that we need to collect all mounts from all namespaces. v2: dump mntns separately Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Now we supports sub-mntns, so root_ns_mask sounds more correct than current_ns_mask. v2: typo fix Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
v2: another attempt to write readable code:) v3: clean up Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Known issue: * currently only namespaces with the same root is supported * nested namespaces can be dumped and restored only if the root task has own mount namespace. All nested namespaces are restored in a root namespace in temporary directories. All mount points restored in one tree and then they are divided into namesaces. The task with minimal pid for each namespaces unshared mntns and then it makes pivot_root in a proper temporary directory. All other tasks makes setns to enter into a mount namespace of the task with minimal pid. v2: clean up Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
All non-root namespaces will be restored as sub-trees of the root tree. This patch adds helpers to create a temporary directory and mount tmpfs in it, then create directories for each non-root mount namespace. tmpfs is quite useful here to simplify destroying this construction, we don't need to unmount each namespace separately. v2: add a comment why MNT_DETACH is not dangerous here Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
read_mnt_ns_img() is splited on two parts. The first part enumirates all namespaces and call the second part, which read a proper image file. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Currently we support nested mount namespaces, only if all of them have the same path to the root. crtools doesn't mount root, so it should be bind-mounted for all namespaces. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Each sub-namespace is restored as sub-tree of the root mntns, so the parent of sub-mntns root is the root of the root mntns. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
When we'll restore nested mount namespaces, all but root ones (sub-namespaces) will be restored as sub-mounts in the root mount namespace. So mi->mountpoint will be not '/' even if a mount is root for its mntns. v2: s/is_root/is_ns_root/ Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Currently ns_ids list is filled only on dump. Soon we'll need this list for mount namespaces on restore, e.g. to know which tasks share the namespaces. v2: merge the patch "namespace: add a function to search an ns_id item by id" into this one. v3: add prefix rst_ to add_ns_id v4: look up namespace by two values -- type AND ID Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
We are going to restore nested mount namespaces and we will need to change root for each of them. v2: don't call chdir in a second time, because a path may be relative Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Currently it's initialized for the root mount namespace, but we are going to dump nested mount namespaces. It's used in open_mountpoint(), which is used in dump_tmpfs() and in other callbacks. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
We're about to collect root several times in a row, so keeping the old one isn't required. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
We have a race. Consider we have 3 tasks, A, B and C. A and B share fdtable, C -- does not. Then we might be in a situation when A is restoring memory reading mem images, and B -- forking the C child. In that case descriptors held by A (for mem restore) will be inherited by C and will not get closed. This reverts commit d36e07aa.
-
- 18 Apr, 2014 4 commits
-
-
Andrey Vagin authored
Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrew Vagin authored
BTRFS returns subvolume dev-id instead of superblock dev-id Signed-off-by:
Andrew Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrew Vagin authored
BTRFS returns subvolume dev-id instead of superblock dev-id, so we need to know which mounts are btrfs. The mi->fstype->name is "unsuppoerted" here, because the fstype->code is saved in an image { .name = "unsupported", .code = FSTYPE__UNSUPPORTED, }, { .name = "btrfs", .code = FSTYPE__UNSUPPORTED, } An a second reason is that pocesses can be migrated from smth to btrfs. This all can happen _only_ for the root mount and for bind mounts of the root mount... Signed-off-by:
Andrew Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Tikhomirov Pavel authored
here was bug cause if e.g.: iterative snapshots are made and between two of them new process in process tree was created, it can have pages which are non dirty, and won't save them into image. but there is no parent image for it. pages which are non soft-dirty appear if process with some pages in non dirty state forks, child will inherit those pte's and if child don't write to those pages, they will be still in non soft-dirty state when next dump comes. also this bug was not catched because of error in zdtm, look 3/3 v2: simplify, add more justification in commit message. Signed-off-by:
Tikhomirov Pavel <snorcht@gmail.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-