[CRIU] [PATCH] zdtm/mountpoints: wait when a child process opens descriptors

Andrey Vagin avagin at openvz.org
Mon Dec 21 03:55:25 PST 2015


From: Andrew Vagin <avagin at virtuozzo.com>

Otherwise we can see this error:
5: Old files lost: set([])
5: New files appeared: set(['5', '6'])

Reported-by: Mr Jenkins
Signed-off-by: Andrew Vagin <avagin at virtuozzo.com>
---
 test/zdtm/live/static/mountpoints.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/test/zdtm/live/static/mountpoints.c b/test/zdtm/live/static/mountpoints.c
index c921d7c..c1857a0 100644
--- a/test/zdtm/live/static/mountpoints.c
+++ b/test/zdtm/live/static/mountpoints.c
@@ -27,6 +27,8 @@ struct ns_exec_args {
 	int status_pipe[2];
 };
 
+task_waiter_t t;
+
 int ns_child(void *_arg)
 {
 	struct stat st;
@@ -52,6 +54,8 @@ int ns_child(void *_arg)
 
 	pid = fork();
 
+	task_waiter_complete(&t, 1);
+
 	test_waitsig();
 
 	if (pid) {
@@ -80,6 +84,8 @@ int main(int argc, char **argv)
 
 	test_init(argc, argv);
 
+	task_waiter_init(&t);
+
 again:
 	fs_cnt = 0;
 	f = fopen("/proc/self/mountinfo", "r");
@@ -277,6 +283,8 @@ done:
 		}
 	}
 
+	task_waiter_wait4(&t, 1);
+
 	test_daemon();
 	test_waitsig();
 
-- 
2.4.3



More information about the CRIU mailing list