From 7f3de2889e1ac79059b3e9094c89c4633ecf9aa7 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Mon, 23 Jun 2014 16:49:40 +0400 Subject: [PATCH] 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: Cyrill Gorcunov Signed-off-by: Pavel Emelyanov --- pie/restorer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/pie/restorer.c b/pie/restorer.c index d4ab24f3a..99255f425 100644 --- a/pie/restorer.c +++ b/pie/restorer.c @@ -887,6 +887,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);