[CRIU] [PATCH] restore: Make sure the last_pid is writen with zero offset

Cyrill Gorcunov gorcunov at openvz.org
Mon Jun 23 00:27:13 PDT 2014


Otherwise I see on 3.16-rc1 and higher

| [  100.851730] futex wrote to ns_last_pid when file position was not 0!
| This will not be supported in the future. To silence this
| warning, set kernel.sysctl_writes_strict = -1

Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 pie/restorer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pie/restorer.c b/pie/restorer.c
index 421bb90f3c84..701e7ddef2dc 100644
--- a/pie/restorer.c
+++ b/pie/restorer.c
@@ -911,6 +911,7 @@ long __export_restore_task(struct task_restore_args *args)
 
 			new_sp = restorer_stack(thread_args + i);
 			last_pid_len = vprint_num(last_pid_buf, sizeof(last_pid_buf), thread_args[i].pid - 1, &s);
+			sys_lseek(fd, 0, SEEK_SET);
 			ret = sys_write(fd, s, last_pid_len);
 			if (ret < 0) {
 				pr_err("Can't set last_pid %ld/%s\n", ret, last_pid_buf);
-- 
1.9.3



More information about the CRIU mailing list