Skip to contentSkip to conversation

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

PATCH Stephen Rothwell 2 participants 3 messages May 12, 2020

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the pidfd tree, today's linux-next build (x86_64 allnoconfig) failed like this:

fs/nsfs.c:232:6: error: redefinition of 'proc_ns_file'
232 | bool proc_ns_file(const struct file *file)

      |      ^~~~~~~~~~~~
In file included from fs/nsfs.c:6:
include/linux/proc_fs.h:194:20: note: previous definition of 'proc_ns_file' was here
  194 | static inline bool proc_ns_file(const struct file *file)
      |                    ^~~~~~~~~~~~

Caused by commit

1e76b8ad203a ("nsproxy: attach to namespaces via pidfds")

I have applied the following hack for today:

From 07065344c6fb39c440b0de5f75842066bc97a675 Mon Sep 17 00:00:00 2001
From: Stephen Rothwell <[email protected]>
Date: Tue, 12 May 2020 20:08:51 +1000
Subject: [PATCH] nsproxy: protect proc_ns_file() when CONFIG_PROC_FS is not set

---
 fs/nsfs.c | 2 ++
 1 file changed, 2 insertions(+)
fs/nsfs.c +2 -0
index 800c1d0eb0d0..9215ad7597d6 100644
@@ -229,10 +229,12 @@ int ns_get_name(char *buf, size_t size, struct task_struct *task,
 	return res;
 }
 
+#ifdef CONFIG_PROC_FS
 bool proc_ns_file(const struct file *file)
 {
 	return file->f_op == &ns_file_operations;
 }
+#endif
 
 struct file *proc_ns_fget(int fd)
 {
Signature · 5 lines
2.26.2

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

Hi all,

After merging the pidfd tree, today's linux-next build (x86_64 allnoconfig) failed like this:

fs/nsfs.c:232:6: error: redefinition of 'proc_ns_file'
232 | bool proc_ns_file(const struct file *file)

      |      ^~~~~~~~~~~~
In file included from fs/nsfs.c:6:
include/linux/proc_fs.h:194:20: note: previous definition of 'proc_ns_file' was here
  194 | static inline bool proc_ns_file(const struct file *file)
      |                    ^~~~~~~~~~~~
Quoted 5 lines

Caused by commit

1e76b8ad203a ("nsproxy: attach to namespaces via pidfds")

I have applied the following hack for today:

Thanks for spotting this. I'll fix this now.

Christian

Quoted 34 lines

From 07065344c6fb39c440b0de5f75842066bc97a675 Mon Sep 17 00:00:00 2001
From: Stephen Rothwell <[email protected]>
Date: Tue, 12 May 2020 20:08:51 +1000
Subject: [PATCH] nsproxy: protect proc_ns_file() when CONFIG_PROC_FS is not set

---
 fs/nsfs.c | 2 ++
 1 file changed, 2 insertions(+)
fs/nsfs.c +2 -0
index 800c1d0eb0d0..9215ad7597d6 100644
@@ -229,10 +229,12 @@ int ns_get_name(char *buf, size_t size, struct task_struct *task,
 	return res;
 }
 
+#ifdef CONFIG_PROC_FS
 bool proc_ns_file(const struct file *file)
 {
 	return file->f_op == &ns_file_operations;
 }
+#endif
 
 struct file *proc_ns_fget(int fd)
 {
Signature · 5 lines
2.26.2

-- 
Cheers,
Stephen Rothwell
#2 lore raw
Quoted 14 lines · Christian Brauner
Quoted 13 lines · Stephen Rothwell

Hi all,

After merging the pidfd tree, today's linux-next build (x86_64 allnoconfig) failed like this:

fs/nsfs.c:232:6: error: redefinition of 'proc_ns_file'
232 | bool proc_ns_file(const struct file *file)

      |      ^~~~~~~~~~~~
In file included from fs/nsfs.c:6:
include/linux/proc_fs.h:194:20: note: previous definition of 'proc_ns_file' was here
  194 | static inline bool proc_ns_file(const struct file *file)
      |                    ^~~~~~~~~~~~
Quoted 7 lines
Quoted 5 lines

Caused by commit

1e76b8ad203a ("nsproxy: attach to namespaces via pidfds")

I have applied the following hack for today:

Thanks for spotting this. I'll fix this now.

include/linux/proc_fs.h +3 -7
index acfd5012db4e..592a6e47b235 100644
@@ -70,7 +70,7 @@ struct proc_dir_entry *proc_create_single_data(const char *name, umode_t mode,
                int (*show)(struct seq_file *, void *), void *data);
 #define proc_create_single(name, mode, parent, show) \
        proc_create_single_data(name, mode, parent, show, NULL)
-
+
 extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
                                               struct proc_dir_entry *,
                                               const struct proc_ops *,
@@ -104,7 +104,6 @@ struct proc_dir_entry *proc_create_net_single_write(const char *name, umode_t mo
                                                    proc_write_t write,
                                                    void *data);
 extern struct pid *tgid_pidfd_to_pid(const struct file *file);
-extern bool proc_ns_file(const struct file *file);
 
 #ifdef CONFIG_PROC_PID_ARCH_STATUS
 /*
@@ -160,11 +159,6 @@ static inline struct pid *tgid_pidfd_to_pid(const struct file *file)
        return ERR_PTR(-EBADF);
 }
 
-static inline bool proc_ns_file(const struct file *file)
-{
-       return false;
-}
-
 #endif /* CONFIG_PROC_FS */
 
 struct net;
@@ -185,4 +179,6 @@ static inline struct pid_namespace *proc_pid_ns(const struct inode *inode)
        return inode->i_sb->s_fs_info;
 }
 
+bool proc_ns_file(const struct file *file);
+
 #endif /* _LINUX_PROC_FS_H */

should fix it cleanly.

Thanks, I've added an allnoconfig to my local tests now!

Christian