From b7f0af3ac90d38a136fb40103af2d02e0982c596 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Thu, 25 Feb 2016 10:18:00 +0300 Subject: [PATCH] criu: cgroup -- Don't use PAGE_SIZE inside parasite args MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This cause problem on ppc64 | gcc -c -O2 -g -Wall -Werror -DCONFIG_PPC64 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE | -fno-strict-aliasing -iquote /home/cyrill/criu/criu/include -iquote /home/cyrill/criu/images | -iquote /home/cyrill/criu/criu/pie -iquote /home/cyrill/criu/criu/arch/ppc64 | -iquote /home/cyrill/criu/criu/arch/ppc64/include -iquote /home/cyrill/criu/ -I/usr/include/libnl3 | -iquote ppc64 -DCONFIG_PPC64 -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE parasite-syscall.c -o parasite-syscall.o | parasite-syscall.c: In function ‘parasite_dump_cgroup’: | parasite-syscall.c:1283:2: error: size of unnamed array is negative | ca = parasite_args(ctl, struct parasite_dump_cgroup_args); | ^ | /home/cyrill/criu/scripts/nmk/scripts/rules.mk:53: recipe for target 'parasite-syscall.o' failed Just use size parasite known to support. Signed-off-by: Cyrill Gorcunov Acked-by: Laurent Dufour Acked-by: Tycho Andersen Signed-off-by: Pavel Emelyanov --- criu/include/parasite.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/criu/include/parasite.h b/criu/include/parasite.h index e3383d802..6ca56f7c3 100644 --- a/criu/include/parasite.h +++ b/criu/include/parasite.h @@ -247,13 +247,12 @@ struct parasite_tty_args { }; struct parasite_dump_cgroup_args { - /* We choose PAGE_SIZE here since that's how big parasite messages are, - * although this is probably longer than any /proc/pid/cgroup file will - * ever be on most systems (4k). + /* + * 4K should be enough for most cases. * * The string is null terminated. */ - char contents[PAGE_SIZE]; + char contents[PARASITE_ARG_SIZE_MIN]; }; /* the parasite prefix is added by gen_offsets.sh */