The page-pipe buffers may be reused once queued pages are
dumped, but we happen to increase page_pipe::nr_pipes
all the timer, regardless the fact where page buffer
came from.
In worst scenario this may lead to incorrect -EAGAIN returned
from page_pipe_grow forcing calling code to create new
pipes. This is not critical but should be fixed.
In other words page_pipe::nr_pipes must track _really_
created pipes.
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
We have made big step towards C/R of LXC containers -- made support
for nested mount namespaces and addressed the re-attach issue. Also
we have AArch64 support merged.
Some work is still to be done, but it's good time to show what we
have so far, thus -- the 1.3-rc1.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
It's possible that a procfs mounted somewhere other than /proc
is in use.
Signed-off-by: Christopher Covington <cov@codeaurora.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Nested mount namespaces should be checked only if fdinfo contains mnt_id
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
The nsid lookup will search for mount in case mnt_id
is given. No need to do it twice (the 2nd time for
sanity check).
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This is more logical -- we should remap file in namespace,
not in pid. Also this would help to clean the code further.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This reverts commit f55a0b912c2bb105513b5f6e08a024958968ab9a.
The collected mounts list a) points to nsid and b) should be
put on nsid's mntinfo_tree. Thus is _should_ be done by separate
calls.
Nowadays this routine is mainly used for getting an
fd, rather than keeping one for future reference.
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Now mntns_collect_root() should be called each time when we need to get
a root of a specified namespace and we don't need to call it for
initializing the global variable.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
In the early draft of kcmp syscall it has been returning
[-1|0|1] values but finally [0|1|2] were merged into the
kernel, but I forgot to update the criu code. The good
thing is that because we're using rbtree the kcmp results
are still sorted and tree is balanced but sometime we may
take a wrong branch generating new ID even if the object
is present in the tree which eventually may lead to dump
faulure.
Reported-by: Deyan Doychev <deyan@1h.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
Acked-by: Andrew Vagin <avagin@parallels.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
When we don't know mnt_id, we don't know to which namespace a file
belongs.
Signed-off-by: Andrey Vagin <avagin@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
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>
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>
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>