Skip to contentSkip to conversation

linux-next: build failure after merge of the userns tree

PATCH Applied Stephen Rothwell 2 participants 2 messages Mar 28, 2018 Linux-next tree

lore
Share & tools
lore
#0 lore raw

Hi Eric,

After merging the userns tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:

In file included from include/linux/sched.h:16:0,
from arch/powerpc/lib/xor_vmx_glue.c:14:
include/linux/shm.h:17:35: error: 'struct file' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]

 bool is_file_shm_hugepages(struct file *file);
                                   ^~~~

and many, many more (most warnings, but some errors - arch/powerpc is mostly built with -Werror)

Maybe caused by commit

1a5c1349d105 ("sem: Move struct sem and struct sem_array into ipc/sem.c")

I have appplied the following fix patch for today:

From: Stephen Rothwell <[email protected]>
Date: Wed, 28 Mar 2018 18:36:27 +1100
Subject: [PATCH] fix up for struct file no longer being available in shm.h

---
 include/linux/shm.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/shm.h +2 -0
index 3a8eae3ca33c..d8e69aed3d32 100644
@@ -7,6 +7,8 @@
 #include <uapi/linux/shm.h>
 #include <asm/shmparam.h>
 
+struct file;
+
 #ifdef CONFIG_SYSVIPC
 struct sysv_shm {
 	struct list_head shm_clist;
Signature · 5 lines
2.16.1

-- 
Cheers,
Stephen Rothwell
#1 lore raw
Quoted 18 lines · Stephen Rothwell

Hi Eric,

After merging the userns tree, today's linux-next build (powerpc ppc64_defconfig) produced this warning:

In file included from include/linux/sched.h:16:0,
from arch/powerpc/lib/xor_vmx_glue.c:14:
include/linux/shm.h:17:35: error: 'struct file' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]

 bool is_file_shm_hugepages(struct file *file);
                                   ^~~~

and many, many more (most warnings, but some errors - arch/powerpc is mostly built with -Werror)

Maybe caused by commit

1a5c1349d105 ("sem: Move struct sem and struct sem_array into ipc/sem.c")

Quoted 7 lines

I have appplied the following fix patch for today:

From: Stephen Rothwell <[email protected]>
Date: Wed, 28 Mar 2018 18:36:27 +1100
Subject: [PATCH] fix up for struct file no longer being available in shm.h

Applied. With the addition of:

Quoted 9 lines

I dug through this and I discovered that the error was caused by the removal of struct shmid_kernel from shm.h when building on powerpc. Except for observing the existence of "struct file *shm_file" in struct shmid_kernel I have no clue why the structure move would cause such a failure. I suspect shm.h always needed the forward declaration and someting had been confusing gcc into not issuing the warning. --EWB

Fixes a2e102cd3cdd ("shm: Move struct shmid_kernel into ipc/shm.c")

Has anyone ever seen anything like that?

Eric