- 12 Nov, 2014 12 commits
-
-
Andrey Vagin authored
Fedora bind-mounts a part of the root mount to itself. Currently we don't allow to mount children of a shared mount, if other mount from this shared group are not mounted. This patch adds an exclusion for cases, when a child has the same group. We allow to mount a child, if wider mounts are mounted. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Currently we connect roots of sub-namespaces to the root of the root mount namespace. And we get problems, if the root of the root mntns is shared, because all children of a shared mount must be propagated to other mounts in this group. Actually we mount tmpfs in mnt_roots and here is nothing wrong to add it in a tree. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
And use the expression for it, it's quite short. This makes the amount of variables in the code fit into brains. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com> Acked-by:
Andrew Vagin <avagin@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com> Acked-by:
Andrew Vagin <avagin@parallels.com>
-
Pavel Emelyanov authored
Do paths conversions and checks step-by-step and add many comments what we do in each step and why. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com> Acked-by:
Andrew Vagin <avagin@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com> Acked-by:
Andrew Vagin <avagin@parallels.com>
-
Pavel Emelyanov authored
When we check whether a submount of a mount is visible in another mount (shared peer of the latter), we can and should use the new issubpath helper. Should because the used strncmp may scan beyond ct_mpnt_rpath if its length is smaller (no checks for this in the code). Signed-off-by:
Pavel Emelyanov <xemul@parallels.com> Acked-by:
Andrew Vagin <avagin@parallels.com>
-
Pavel Emelyanov authored
These are constant for given m, so calculate them outside of the loop. Also rename them to reflect what they are. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com> Acked-by:
Andrew Vagin <avagin@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com> Acked-by:
Andrew Vagin <avagin@parallels.com>
-
Pavel Emelyanov authored
The path lenght is zero for the "/" one and strlen(path) for all the others. This is done so to make it possible to use this length to get tail-paths: if path_1 starts with path_2 and both are absolute, then path_1 + path_length(path_2) would give the tail of the tail of path_1 relative to path_2 even if the path_2 is just "/". Signed-off-by:
Pavel Emelyanov <xemul@parallels.com> Acked-by:
Andrew Vagin <avagin@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com> Acked-by:
Andrew Vagin <avagin@parallels.com>
-
Andrey Vagin authored
A problem which is solved in this path is that some children can be unaccessiable (unvisiable) for non-root bind-mounts root mount point ------------------- / /a (shared:1) / /a/x / /a/x/y / /a/z /x /b (shared:1) / /b/y /b is a non-root bind-mount of /a /y is visiable to both mounts /z is vidiable only for /a Before this patch we checked that the set of children is the same for all mount in a shared group. Now we check that a visiable set of mounts is the same for all mounts in a shared group. Now we take the next mount in the shared group, which is wider or equal to current and compare children between them. Before this patch validate_shared(m) validates the m->parent mount. Now it validates the "m" mount. So you can find following lines in the patch: - if (m->parent->shared_id && validate_shared(m)) + if (m->shared_id && validate_shared(m)) We doesn't support shared mounts with different set of children. Here is an example of such case can be created: mount tmpfs a /a mount --make-shared /a mkdir /a/b mount tmpfs b /a/b mount --bind /a /c In this case /c doesn't have the /b child. To support such cases, we need to sort all shared mounts accoding with a set of children. v2: If root is equal to "/", its len should be zero. We expect that the last symbol in a path is not "/". Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 11 Nov, 2014 22 commits
-
-
Andrew Vagin authored
expr ns/user/static/env00 ns/user expr: syntax error Signed-off-by:
Andrew Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Cyrill Gorcunov authored
Signed-off-by:
Cyrill Gorcunov <gorcunov@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Make their name look similar. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
We have sanity check for zombie-with kids below, no need in additional. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
We scan threads and children list several times while freezing the tree, this is done to avoid race with new threads/kids appearing. Factor out the iterations code. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
To make the threads collect code be structured similar to children collect. This will also help in further patching. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Keeping the whole stat buf it too much information. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Right now it returns the whole struct stat which is excessive. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Not to spoil the global namespace and unify the kerndat data names. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
Currently this test creates one process and wait it. So most part of the time this test has only one process without children. 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
For other tests set of file descriptors can be changed Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com> Acked-by:
Andrew Vagin <avagin@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
Right now we push all the auxiliary arguments to parasite_infect_seized while 2 of them are only required to calculate the size of args area. Let's better keep track of required args size and get rid of excessive arguments to parasite_infect_seized(). Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 10 Nov, 2014 3 commits
-
-
Pavel Emelyanov authored
Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
We need to know this to insert holes. Currently xfer->parent isn't initialized for remote sessions. In most cases it has a non-zero value, so generate_iovs() is called with has_parent = true. bash test/zdtm.sh -p -P -i 3 ns/transition/fork (00.000106) Error (sysctl.c:194): Can't open sysctl net/ipv4/tcp_wmem: No such file or directory (00.017048) 420: Error (image.c:231): Unable to open pagemap-420.img: No such file or directory (00.017065) 420: Error (image.c:231): Unable to open pages-420.img: No such file or directory (00.017090) 420: Error (page-read.c:73): No parent for snapshot pagemap (00.017290) 86: Error (cr-restore.c:1185): 420 exited, status=1 (00.017317) Error (cr-restore.c:1831): Restoring FAILED. v2: add a new command to open a page server. It's required to save backward compatibility. If someone tries to use an old version of page server, he will get an error. Reported-by: Mr Jenkins Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Andrey Vagin authored
We do the same for other features. Here is an exception in case of the --ms option. Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 09 Nov, 2014 1 commit
-
-
Pavel Emelyanov authored
ispathsub("/foo", "/") reports false. This is a corner case, as 2nd argument is not expected to end with /. Fix this and add comment about ispathsub() arguments assumptions. Reported-by:
Andrey Vagin <avagin@parallels.com> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
- 07 Nov, 2014 2 commits
-
-
Andrey Vagin authored
Restoring mount namespaces requires to create temporary directories in a test root. When tests execute in a new userns, they have non-zero gid and uid, so we need to grant permissions for them. v2: add +rx as well Reported-by: Mr Jenkins Signed-off-by:
Andrey Vagin <avagin@openvz.org> Signed-off-by:
Pavel Emelyanov <xemul@parallels.com>
-
Pavel Emelyanov authored
When we validate the mount tree not to have overmounts we need to check one path to be the sub-path of another. Here's a helper for this. Signed-off-by:
Pavel Emelyanov <xemul@parallels.com> Acked-by:
Andrew Vagin <avagin@parallels.com>
-