diff options
author | Pavel Tikhomirov <ptikhomirov@virtuozzo.com> | 2022-07-27 16:03:25 +0300 |
---|---|---|
committer | Andrei Vagin <avagin@gmail.com> | 2022-08-04 04:54:52 +0300 |
commit | 0576f68d0ac0a781b326168508d507c0ac56914c (patch) | |
tree | 85fac58a5f06dfd7d36f9ec5bf25c06b99bcf479 /test | |
parent | 973b4b631577e896f07dc7126e5cdc0af27515e5 (diff) |
zdtm/mnt_root_ext: don't allow propagation from test mntns to criu mntns
This test specifically wants to create external bind-mount of "/" from
criu mntns to test mntns, and it wants "/" in criu mntns to be a shared
mount so that "external" mount in the test mntns is it's slave. This is
to triger specific dirname() resolution which happens only when sharing
restore is involved for external mounts, and only if rootfs is involved.
But initially I missed that when we create external mount in test's
temporary mntns it creates a propagation in criu mntns on top of root
mount. This mount may influence other tests restore as child mount in
root mount converts to locked child mount in criu service mntns (for uns
flavour) and when criu would restore root container mount it would fail
with EINVAL on non recursive bind with locked children.
To fix this mess we just need to prohibit propagating from tests
temporary mntns to criu mntns by making mounts slave.
Fixes: #1941
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/zdtm/static/mnt_root_ext.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/zdtm/static/mnt_root_ext.c b/test/zdtm/static/mnt_root_ext.c index 6a2eb068c..305e87262 100644 --- a/test/zdtm/static/mnt_root_ext.c +++ b/test/zdtm/static/mnt_root_ext.c @@ -52,6 +52,14 @@ int main(int argc, char **argv) } /* + * Make mounts in temporary mntns slave, to prevent propagation to criu mntns + */ + if (mount(NULL, "/", NULL, MS_SLAVE | MS_REC, NULL)) { + pr_perror("make rslave"); + return 1; + } + + /* * Populate to the tests root host's rootfs subdir */ if (mount(tmp, testdir, NULL, MS_BIND, NULL)) { |