linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build failure after merge of the final tree (namespace tree related)
@ 2011-05-12  3:51 Stephen Rothwell
  2011-05-12 22:27 ` Eric W. Biederman
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Rothwell @ 2011-05-12  3:51 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: linux-next, linux-kernel

Hi all,

After merging the final tree, today's linux-next build (powerpc
ppc44x_defconfig) failed like this:

net/built-in.o: In function `get_net_ns_by_fd':
(.text+0x11976): undefined reference to `netns_operations'
net/built-in.o: In function `get_net_ns_by_fd':
(.text+0x1197a): undefined reference to `netns_operations'

netns_operations is only available if CONFIG_NET_NS is set ...

Caused by commit f063052947f7 ("net: Allow setting the network namespace
by fd").

I applied the patch below for today.

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Thu, 12 May 2011 13:41:16 +1000
Subject: [PATCH] net: fix get_net_ns_by_fd for !CONFIG_NET_NS

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 net/core/net_namespace.c |   49 +++++++++++++++++++++++++--------------------
 1 files changed, 27 insertions(+), 22 deletions(-)

diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index bddcaff..e630588 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -304,6 +304,28 @@ void __put_net(struct net *net)
 }
 EXPORT_SYMBOL_GPL(__put_net);
 
+struct net *get_net_ns_by_fd(int fd)
+{
+	struct proc_inode *ei;
+	struct file *file;
+	struct net *net;
+
+	net = ERR_PTR(-EINVAL);
+	file = proc_ns_fget(fd);
+	if (!file)
+		goto out;
+
+	ei = PROC_I(file->f_dentry->d_inode);
+	if (ei->ns_ops != &netns_operations)
+		goto out;
+
+	net = get_net(ei->ns);
+out:
+	if (file)
+		fput(file);
+	return net;
+}
+
 #else
 struct net *copy_net_ns(unsigned long flags, struct net *old_net)
 {
@@ -311,6 +333,11 @@ struct net *copy_net_ns(unsigned long flags, struct net *old_net)
 		return ERR_PTR(-EINVAL);
 	return old_net;
 }
+
+struct net *get_net_ns_by_fd(int fd)
+{
+	return ERR_PTR(-EINVAL);
+}
 #endif
 
 struct net *get_net_ns_by_pid(pid_t pid)
@@ -333,28 +360,6 @@ struct net *get_net_ns_by_pid(pid_t pid)
 }
 EXPORT_SYMBOL_GPL(get_net_ns_by_pid);
 
-struct net *get_net_ns_by_fd(int fd)
-{
-	struct proc_inode *ei;
-	struct file *file;
-	struct net *net;
-
-	net = ERR_PTR(-EINVAL);
-	file = proc_ns_fget(fd);
-	if (!file)
-		goto out;
-
-	ei = PROC_I(file->f_dentry->d_inode);
-	if (ei->ns_ops != &netns_operations)
-		goto out;
-
-	net = get_net(ei->ns);
-out:
-	if (file)
-		fput(file);
-	return net;
-}
-
 static int __init net_ns_init(void)
 {
 	struct net_generic *ng;
-- 
1.7.5.1

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: linux-next: build failure after merge of the final tree (namespace tree related)
  2011-05-12  3:51 linux-next: build failure after merge of the final tree (namespace tree related) Stephen Rothwell
@ 2011-05-12 22:27 ` Eric W. Biederman
  0 siblings, 0 replies; 2+ messages in thread
From: Eric W. Biederman @ 2011-05-12 22:27 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel

Stephen Rothwell <sfr@canb.auug.org.au> writes:

> Hi all,
>
> After merging the final tree, today's linux-next build (powerpc
> ppc44x_defconfig) failed like this:
>
> net/built-in.o: In function `get_net_ns_by_fd':
> (.text+0x11976): undefined reference to `netns_operations'
> net/built-in.o: In function `get_net_ns_by_fd':
> (.text+0x1197a): undefined reference to `netns_operations'
>
> netns_operations is only available if CONFIG_NET_NS is set ...
>
> Caused by commit f063052947f7 ("net: Allow setting the network namespace
> by fd").
>
> I applied the patch below for today.

How embarrassing.  I should have caught this one myself.

I have applied your patch.  


At some point I need to see what the impact of removing the various
CONFIG_XXX_NS defines is and get rid of them.  Their original purpose
was only to let administrators avoid buggy code, but most of the
namespaces are well beyond where that now and it seems those
CONFIG_XXX_NS defines are just causing trouble.  But not for 2.6.40.

Eric

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-05-12 22:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-12  3:51 linux-next: build failure after merge of the final tree (namespace tree related) Stephen Rothwell
2011-05-12 22:27 ` Eric W. Biederman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).