Commit 7f3de288 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

restore: Make sure the last_pid is writen with zero offset

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: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 687c3894
...@@ -887,6 +887,7 @@ long __export_restore_task(struct task_restore_args *args) ...@@ -887,6 +887,7 @@ long __export_restore_task(struct task_restore_args *args)
new_sp = restorer_stack(thread_args + i); 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); 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); ret = sys_write(fd, s, last_pid_len);
if (ret < 0) { if (ret < 0) {
pr_err("Can't set last_pid %ld/%s\n", ret, last_pid_buf); pr_err("Can't set last_pid %ld/%s\n", ret, last_pid_buf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment