OpenVZ Forum


Home » Mailing lists » Devel » [PATCH 0/3 net-2.6.26] Compilation fixes.
[PATCH 0/3 net-2.6.26] Compilation fixes. [message #28897] Mon, 31 March 2008 15:46 Go to next message
den is currently offline  den
Messages: 494
Registered: December 2005
Senior Member
Hello, Dave!

Recently I have seen several issues post to the netdev@ blaming
inclusion of the net_namespace.h from seq_file. This set fixes this
problem after two small cleanups.

Regards,
	Den

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
[PATCH 1/3 net-2.6.26] [NETNS]: Merge ifdef CONFIG_NET in include/net/net_namespace.h. [message #28898 is a reply to message #28897] Mon, 31 March 2008 15:47 Go to previous messageGo to next message
den is currently offline  den
Messages: 494
Registered: December 2005
Senior Member
Signed-off-by: Denis V. Lunev <den@openvz.org>
---
 include/net/net_namespace.h |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index f8f3d1a..035ebff 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -61,25 +61,27 @@ struct net {
 #endif
 };
 
+
 #ifdef CONFIG_NET
 /* Init's network namespace */
 extern struct net init_net;
 #define INIT_NET_NS(net_ns) .net_ns = &init_net,
-#else
-#define INIT_NET_NS(net_ns)
-#endif
 
-extern struct list_head net_namespace_list;
-
-#ifdef CONFIG_NET
 extern struct net *copy_net_ns(unsigned long flags, struct net *net_ns);
-#else
+
+#else /* CONFIG_NET */
+
+#define INIT_NET_NS(net_ns)
+
 static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns)
 {
 	/* There is nothing to copy so this is a noop */
 	return net_ns;
 }
-#endif
+#endif /* CONFIG_NET */
+
+
+extern struct list_head net_namespace_list;
 
 #ifdef CONFIG_NET_NS
 extern void __put_net(struct net *net);
-- 
1.5.3.rc5

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
[PATCH 2/3 net-2.6.26] [NETNS]: Remove ifdef CONFIG_NET braces in fs/proc/proc_net.c. [message #28899 is a reply to message #28897] Mon, 31 March 2008 15:47 Go to previous messageGo to next message
den is currently offline  den
Messages: 494
Registered: December 2005
Senior Member
They are redundant as this file is linked in iff CONFIG_NET is turned on.

Signed-off-by: Denis V. Lunev <den@openvz.org>
---
 fs/proc/proc_net.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/fs/proc/proc_net.c b/fs/proc/proc_net.c
index 7034fac..13cd783 100644
--- a/fs/proc/proc_net.c
+++ b/fs/proc/proc_net.c
@@ -51,7 +51,6 @@ int seq_open_net(struct inode *ino, struct file *f,
 }
 EXPORT_SYMBOL_GPL(seq_open_net);
 
-#ifdef CONFIG_NET
 int seq_release_net(struct inode *ino, struct file *f)
 {
 	struct seq_file *seq;
@@ -219,4 +218,3 @@ int __init proc_net_init(void)
 
 	return register_pernet_subsys(&proc_net_ns_ops);
 }
-#endif /* CONFIG_NET */
-- 
1.5.3.rc5

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
[PATCH 3/3 net-2.6.26] [NETNS]: Do not include net/net_namespace.h from seq_file.h [message #28900 is a reply to message #28897] Mon, 31 March 2008 15:47 Go to previous messageGo to next message
den is currently offline  den
Messages: 494
Registered: December 2005
Senior Member
Signed-off-by: Denis V. Lunev <den@openvz.org>
---
 include/linux/seq_file.h     |   22 ----------------------
 include/linux/seq_file_net.h |   27 +++++++++++++++++++++++++++
 include/net/net_namespace.h  |    2 ++
 3 files changed, 29 insertions(+), 22 deletions(-)
 create mode 100644 include/linux/seq_file_net.h

diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index 5da70c3..1da1e62 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -5,7 +5,6 @@
 #include <linux/types.h>
 #include <linux/string.h>
 #include <linux/mutex.h>
-#include <net/net_namespace.h>
 
 struct seq_operations;
 struct file;
@@ -63,26 +62,5 @@ extern struct list_head *seq_list_start_head(struct list_head *head,
 extern struct list_head *seq_list_next(void *v, struct list_head *head,
 		loff_t *ppos);
 
-#ifdef CONFIG_NET
-struct net;
-struct seq_net_private {
-#ifdef CONFIG_NET_NS
-	struct net *net;
-#endif
-};
-
-int seq_open_net(struct inode *, struct file *,
-		 const struct seq_operations *, int);
-int seq_release_net(struct inode *, struct file *);
-static inline struct net *seq_file_net(struct seq_file *seq)
-{
-#ifdef CONFIG_NET_NS
-	return ((struct seq_net_private *)seq->private)->net;
-#else
-	return &init_net;
-#endif
-}
-#endif	/* CONFIG_NET */
-
 #endif
 #endif
diff --git a/include/linux/seq_file_net.h b/include/linux/seq_file_net.h
new file mode 100644
index 0000000..4ac5254
--- /dev/null
+++ b/include/linux/seq_file_net.h
@@ -0,0 +1,27 @@
+#ifndef __SEQ_FILE_NET_H__
+#define __SEQ_FILE_NET_H__
+
+#include <linux/seq_file.h>
+
+struct net;
+extern struct net init_net;
+
+struct seq_net_private {
+#ifdef CONFIG_NET_NS
+	struct net *net;
+#endif
+};
+
+int seq_open_net(struct inode *, struct file *,
+		 const struct seq_operations *, int);
+int seq_release_net(struct inode *, struct file *);
+static inline struct net *seq_file_net(struct seq_file *seq)
+{
+#ifdef CONFIG_NET_NS
+	return ((struct seq_net_private *)seq->private)->net;
+#else
+	return &init_net;
+#endif
+}
+
+#endif
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 035ebff..35b6752 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -63,6 +63,8 @@ struct net {
 
 
 #ifdef CONFIG_NET
+#include <linux/seq_file_net.h>
+
 /* Init's network namespace */
 extern struct net init_net;
 #define INIT_NET_NS(net_ns) .net_ns = &init_net,
-- 
1.5.3.rc5

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH 0/3 net-2.6.26] Compilation fixes. [message #28940 is a reply to message #28897] Wed, 02 April 2008 07:10 Go to previous messageGo to next message
davem is currently offline  davem
Messages: 463
Registered: February 2006
Senior Member
From: "Denis V. Lunev" <den@openvz.org>
Date: Mon, 31 Mar 2008 19:46:01 +0400

> Hello, Dave!
> 
> Recently I have seen several issues post to the netdev@ blaming
> inclusion of the net_namespace.h from seq_file. This set fixes this
> problem after two small cleanups.

All applied, thanks Denis.

I'll push to net-2.6.26 after some build sanity checks.
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH 0/3 net-2.6.26] Compilation fixes. [message #28951 is a reply to message #28940] Wed, 02 April 2008 10:01 Go to previous messageGo to next message
den is currently offline  den
Messages: 494
Registered: December 2005
Senior Member
On Wed, 2008-04-02 at 00:10 -0700, David Miller wrote:
> From: "Denis V. Lunev" <den@openvz.org>
> Date: Mon, 31 Mar 2008 19:46:01 +0400
> 
> > Hello, Dave!
> > 
> > Recently I have seen several issues post to the netdev@ blaming
> > inclusion of the net_namespace.h from seq_file. This set fixes this
> > problem after two small cleanups.
> 
> All applied, thanks Denis.
> 
> I'll push to net-2.6.26 after some build sanity checks.

Dave, could you pls conside this addition. This should fix problem
reported by the Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> recently.

[NETNS]: Declare init_net even without CONFIG_NET defined.

This seems bogus but there is no other way for now. There are several
placec when networking headers are included even without CONFIG_NET and
the possibility of the similar reports in the nearest future is great.

Signed-off-by: Denis V. Lunev <den@openvz.org>
----
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 6c9a48a..0ab62ed 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -60,11 +60,12 @@ struct net {
 };
 
 
-#ifdef CONFIG_NET
 #include <linux/seq_file_net.h>
 
 /* Init's network namespace */
 extern struct net init_net;
+
+#ifdef CONFIG_NET
 #define INIT_NET_NS(net_ns) .net_ns = &init_net,
 
 extern struct net *copy_net_ns(unsigned long flags, struct net *net_ns);

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH 0/3 net-2.6.26] Compilation fixes. [message #28976 is a reply to message #28951] Wed, 02 April 2008 18:42 Go to previous messageGo to next message
davem is currently offline  davem
Messages: 463
Registered: February 2006
Senior Member
From: "Denis V. Lunev" <den@openvz.org>
Date: Wed, 02 Apr 2008 14:01:14 +0400

> On Wed, 2008-04-02 at 00:10 -0700, David Miller wrote:
> > From: "Denis V. Lunev" <den@openvz.org>
> > Date: Mon, 31 Mar 2008 19:46:01 +0400
> > 
> > > Hello, Dave!
> > > 
> > > Recently I have seen several issues post to the netdev@ blaming
> > > inclusion of the net_namespace.h from seq_file. This set fixes this
> > > problem after two small cleanups.
> > 
> > All applied, thanks Denis.
> > 
> > I'll push to net-2.6.26 after some build sanity checks.
> 
> Dave, could you pls conside this addition. This should fix problem
> reported by the Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> recently.

Then this invalidates enourmous amounts of CONFIG_NET tests
we've put into the headers over the past few days.

All of them were explicitly to avoid having to provide the
init_net symbol when CONFIG_NET is not set.
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH 0/3 net-2.6.26] Compilation fixes. [message #28977 is a reply to message #28976] Wed, 02 April 2008 19:46 Go to previous messageGo to next message
den is currently offline  den
Messages: 494
Registered: December 2005
Senior Member
On Wed, 2008-04-02 at 11:42 -0700, David Miller wrote:
> From: "Denis V. Lunev" <den@openvz.org>
> Date: Wed, 02 Apr 2008 14:01:14 +0400
> 
> > On Wed, 2008-04-02 at 00:10 -0700, David Miller wrote:
> > > From: "Denis V. Lunev" <den@openvz.org>
> > > Date: Mon, 31 Mar 2008 19:46:01 +0400
> > > 
> > > > Hello, Dave!
> > > > 
> > > > Recently I have seen several issues post to the netdev@ blaming
> > > > inclusion of the net_namespace.h from seq_file. This set fixes this
> > > > problem after two small cleanups.
> > > 
> > > All applied, thanks Denis.
> > > 
> > > I'll push to net-2.6.26 after some build sanity checks.
> > 
> > Dave, could you pls conside this addition. This should fix problem
> > reported by the Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> recently.
> 
> Then this invalidates enourmous amounts of CONFIG_NET tests
> we've put into the headers over the past few days. 
> 
> All of them were explicitly to avoid having to provide the
> init_net symbol when CONFIG_NET is not set.

OK. do you suggest to insert another CONFIG_NET check into if_pppox
header or separate fs/compat_ioctl.c into two files:
- for net ioctls
- for the rest?

Regards,
	Den

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH 0/3 net-2.6.26] Compilation fixes. [message #28978 is a reply to message #28977] Wed, 02 April 2008 20:56 Go to previous messageGo to next message
davem is currently offline  davem
Messages: 463
Registered: February 2006
Senior Member
From: "Denis V. Lunev" <den@openvz.org>
Date: Wed, 02 Apr 2008 23:46:19 +0400

> On Wed, 2008-04-02 at 11:42 -0700, David Miller wrote:
> > From: "Denis V. Lunev" <den@openvz.org>
> > Date: Wed, 02 Apr 2008 14:01:14 +0400
> > 
> > > Dave, could you pls conside this addition. This should fix problem
> > > reported by the Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> recently.
> > 
> > Then this invalidates enourmous amounts of CONFIG_NET tests
> > we've put into the headers over the past few days. 
> > 
> > All of them were explicitly to avoid having to provide the
> > init_net symbol when CONFIG_NET is not set.
> 
> OK. do you suggest to insert another CONFIG_NET check into if_pppox
> header or separate fs/compat_ioctl.c into two files:
> - for net ioctls
> - for the rest?

It's probably better to go your route.  That is, unprotect
the init_net extern, and remove the CONFIG_NET's we added
which are no longer necessary.

Could you do such a patch set?  Thanks.
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH 0/3 net-2.6.26] Compilation fixes. [message #28979 is a reply to message #28978] Wed, 02 April 2008 21:00 Go to previous messageGo to next message
den is currently offline  den
Messages: 494
Registered: December 2005
Senior Member
On Wed, 2008-04-02 at 13:56 -0700, David Miller wrote:
> From: "Denis V. Lunev" <den@openvz.org>
> Date: Wed, 02 Apr 2008 23:46:19 +0400
> 
> > On Wed, 2008-04-02 at 11:42 -0700, David Miller wrote:
> > > From: "Denis V. Lunev" <den@openvz.org>
> > > Date: Wed, 02 Apr 2008 14:01:14 +0400
> > > 
> > > > Dave, could you pls conside this addition. This should fix problem
> > > > reported by the Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> recently.
> > > 
> > > Then this invalidates enourmous amounts of CONFIG_NET tests
> > > we've put into the headers over the past few days. 
> > > 
> > > All of them were explicitly to avoid having to provide the
> > > init_net symbol when CONFIG_NET is not set.
> > 
> > OK. do you suggest to insert another CONFIG_NET check into if_pppox
> > header or separate fs/compat_ioctl.c into two files:
> > - for net ioctls
> > - for the rest?
> 
> It's probably better to go your route.  That is, unprotect
> the init_net extern, and remove the CONFIG_NET's we added
> which are no longer necessary.
> 
> Could you do such a patch set?  Thanks.

Sure, but, unfortunately, only tomorrow morning. It is too late today in
Moscow :)

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH 0/3 net-2.6.26] Compilation fixes. [message #28980 is a reply to message #28979] Wed, 02 April 2008 21:00 Go to previous messageGo to next message
davem is currently offline  davem
Messages: 463
Registered: February 2006
Senior Member
From: "Denis V. Lunev" <den@openvz.org>
Date: Thu, 03 Apr 2008 01:00:07 +0400

> On Wed, 2008-04-02 at 13:56 -0700, David Miller wrote:
> > From: "Denis V. Lunev" <den@openvz.org>
> > Date: Wed, 02 Apr 2008 23:46:19 +0400
> > 
> > Could you do such a patch set?  Thanks.
> 
> Sure, but, unfortunately, only tomorrow morning. It is too late today in
> Moscow :)

No problem, there is no rush :-)
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH 0/3 net-2.6.26] Compilation fixes. [message #29038 is a reply to message #28980] Thu, 03 April 2008 14:13 Go to previous messageGo to next message
den is currently offline  den
Messages: 494
Registered: December 2005
Senior Member
On Wed, 2008-04-02 at 14:00 -0700, David Miller wrote:
> From: "Denis V. Lunev" <den@openvz.org>
> Date: Thu, 03 Apr 2008 01:00:07 +0400
> 
> > On Wed, 2008-04-02 at 13:56 -0700, David Miller wrote:
> > > From: "Denis V. Lunev" <den@openvz.org>
> > > Date: Wed, 02 Apr 2008 23:46:19 +0400
> > > 
> > > Could you do such a patch set?  Thanks.
> > 
> > Sure, but, unfortunately, only tomorrow morning. It is too late today in
> > Moscow :)
> 
> No problem, there is no rush :-)

pls consider this. I have found only 3 commits related

[NETNS]: Declare init_net even without CONFIG_NET defined.

This does not look good, but there is no other choice. The compilation
without CONFIG_NET is broken and can not be fixed with ease.

After that there is no need for the following commits:
1567ca7eec7664b8be3b07755ac59dc1b1ec76cb
3edf8fa5ccf10688a9280b5cbca8ed3947c42866
2d38f9a4f8d2ebdc799f03eecf82345825495711

Revert them.

Signed-off-by: Denis V. Lunev <den@openvz.org>
----
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c36c76c..8b17ed4 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -741,7 +741,6 @@ struct net_device
 #define	NETDEV_ALIGN		32
 #define	NETDEV_ALIGN_CONST	(NETDEV_ALIGN - 1)
 
-#ifdef CONFIG_NET
 /*
  * Net namespace inlines
  */
@@ -762,7 +761,6 @@ void dev_net_set(struct net_device *dev, struct net *net)
 	dev->nd_net = net;
 #endif
 }
-#endif
 
 /**
  *	netdev_priv - access network device private data
@@ -827,7 +825,6 @@ struct packet_type {
 extern rwlock_t				dev_base_lock;		/* Device list lock */
 
 
-#ifdef CONFIG_NET
 #define for_each_netdev(net, d)		\
 		list_for_each_entry(d, &(net)->dev_base_head, dev_list)
 #define for_each_netdev_safe(net, d, n)	\
@@ -851,7 +848,6 @@ static inline struct net_device *first_net_device(struct net *net)
 	return list_empty(&net->dev_base_head) ? NULL :
 		net_device_entry(net->dev_base_head.next);
 }
-#endif
 
 extern int 			netdev_boot_setup_check(struct net_device *dev);
 extern unsigned long		netdev_boot_base(const char *prefix, int unit);
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 6c9a48a..0ab62ed 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -60,11 +60,12 @@ struct net {
 };
 
 
-#ifdef CONFIG_NET
 #include <linux/seq_file_net.h>
 
 /* Init's network namespace */
 extern struct net init_net;
+
+#ifdef CONFIG_NET
 #define INIT_NET_NS(net_ns) .net_ns = &init_net,
 
 extern struct net *copy_net_ns(unsigned long flags, struct net *net_ns);
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 0d56dad..b06185e 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -19,12 +19,10 @@
 #include <linux/kobject.h>
 #include <linux/module.h>
 
-#ifdef CONFIG_NET
 #include <linux/socket.h>
 #include <linux/skbuff.h>
 #include <linux/netlink.h>
 #include <net/sock.h>
-#endif
 
 
 u64 uevent_seqnum;

_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Re: [PATCH 0/3 net-2.6.26] Compilation fixes. [message #29047 is a reply to message #29038] Thu, 03 April 2008 20:25 Go to previous message
davem is currently offline  davem
Messages: 463
Registered: February 2006
Senior Member
From: "Denis V. Lunev" <den@openvz.org>
Date: Thu, 03 Apr 2008 18:13:52 +0400

> On Wed, 2008-04-02 at 14:00 -0700, David Miller wrote:
> > From: "Denis V. Lunev" <den@openvz.org>
> > Date: Thu, 03 Apr 2008 01:00:07 +0400
> > 
> > > On Wed, 2008-04-02 at 13:56 -0700, David Miller wrote:
> > > > From: "Denis V. Lunev" <den@openvz.org>
> > > > Date: Wed, 02 Apr 2008 23:46:19 +0400
> > > > 
> > > > Could you do such a patch set?  Thanks.
> > > 
> > > Sure, but, unfortunately, only tomorrow morning. It is too late today in
> > > Moscow :)
> > 
> > No problem, there is no rush :-)
> 
> pls consider this. I have found only 3 commits related

Applied, thanks a lot for doing this work.
_______________________________________________
Containers mailing list
Containers@lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers
Previous Topic: [PATCH][ICMP]: Dst entry leak in icmp_send host re-lookup code (v2).
Next Topic: [PATCH 0/3] IPv6 start/stop problems
Goto Forum:
  


Current Time: Sun Jul 13 16:05:39 GMT 2025

Total time taken to generate the page: 0.03103 seconds