From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexey Dobriyan Subject: Re: Identifying network namespaces (was: Network namespace manipulation with file descriptors) Date: Wed, 18 May 2011 16:03:03 +0300 Message-ID: References: <20110518124307.GD3762520@jupiter.n2.diac24.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mail-vx0-f174.google.com ([209.85.220.174]:45650 "EHLO mail-vx0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756907Ab1ERNDF convert rfc822-to-8bit (ORCPT ); Wed, 18 May 2011 09:03:05 -0400 In-Reply-To: <20110518124307.GD3762520@jupiter.n2.diac24.net> Sender: linux-arch-owner@vger.kernel.org List-ID: To: David Lamparter Cc: "Eric W. Biederman" , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-fsdevel@vger.kernel.org, jamal , Daniel Lezcano , Linux Containers , Renato Westphal On Wed, May 18, 2011 at 3:43 PM, David Lamparter w= rote: > - =A0 processes cannot easily be cross referenced with each other > > =A0in the case of user space stuff running astray - like management > =A0software crashing, routing daemons screwing up, etc. - it becomes > =A0fairly difficult to shut down a network namespace (or even reaquir= e > =A0physical devices that have been reassigned) It shutdowns itself when last process using netns disappeares, so if you kill your routing daemons you should be fine. Physical netdevices are moved to init_net. > - =A0 namespaces cannot adequately be identified to the user > > =A0for debugging, some kernel messages become useless. most prominent= ly, > =A0"unregister_netdevice: waiting for lo to become free. Usage count = =3D 123" > =A0could certainly use some clarification, *which* lo is meant... There is no "netns %p" or something, because right now the only unique netns identifier is kernel pointer (which better not be exposed to user= space). Printing such thing would be quite useless since it's not printed at netns creation. > So, considering this set of premises (feedback welcome) I looked for > some suitable means of identification. I discarded going for any proc= ess > identifiers since Eric's patches allow for network namespaces without > any process holding a reference, using bind mounts instead. If anything it should be netns->id, /proc/*/netns outputting id where id is not derived from kernel pointer. > Solution? > =3D=3D=3D=3D=3D=3D=3D=3D=3D What a hack! :-)