[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4C9CABB4.3010002@fr.ibm.com>
Date: Fri, 24 Sep 2010 15:46:28 +0200
From: Daniel Lezcano <dlezcano@...ibm.com>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
CC: linux-kernel@...r.kernel.org,
Sukadev Bhattiprolu <sukadev@...ux.vnet.ibm.com>,
Pavel Emelyanov <xemul@...nvz.org>,
Pavel Emelyanov <xemul@...allels.com>,
Ulrich Drepper <drepper@...il.com>, netdev@...r.kernel.org,
Jonathan Corbet <corbet@....net>,
Jan Engelhardt <jengelh@...ozas.de>,
linux-fsdevel@...r.kernel.org, netfilter-devel@...r.kernel.org,
Michael Kerrisk <mtk.manpages@...il.com>,
Linux Containers <containers@...ts.osdl.org>,
Ben Greear <greearb@...delatech.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
David Miller <davem@...emloft.net>,
Al Viro <viro@...IV.linux.org.uk>
Subject: Re: [PATCH 7/8] net: Allow setting the network namespace by fd
On 09/23/2010 10:51 AM, Eric W. Biederman wrote:
>
> Take advantage of the new abstraction and allow network devices
> to be placed in any network namespace that we have a fd to talk
> about.
>
> Signed-off-by: Eric W. Biederman<ebiederm@...ssion.com>
> ---
[ ... ]
> +struct net *get_net_ns_by_fd(int fd)
> +{
> + struct proc_inode *ei;
> + struct file *file;
> + struct net *net;
> +
> + file = NULL;
> + net = ERR_PTR(-EINVAL);
> + file = proc_ns_fget(fd);
> + if (!fd)
> + goto out;
> + return ERR_PTR(-EINVAL);
> +
> + ei = PROC_I(file->f_dentry->d_inode);
> + if (ei->ns_ops !=&netns_operations)
> + goto out;
Is this check necessary here ? proc_ns_fget checks "file->f_op !=
&ns_file_operations", no ?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists