From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D68B5C2BB1D for ; Mon, 13 Apr 2020 19:40:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B17C82064A for ; Mon, 13 Apr 2020 19:40:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387993AbgDMTkD (ORCPT ); Mon, 13 Apr 2020 15:40:03 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:45325 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387935AbgDMTj6 (ORCPT ); Mon, 13 Apr 2020 15:39:58 -0400 Received: from ip5f5bd698.dynamic.kabel-deutschland.de ([95.91.214.152] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jO4vw-0002kH-3i; Mon, 13 Apr 2020 19:39:52 +0000 Date: Mon, 13 Apr 2020 21:39:50 +0200 From: Christian Brauner To: Tejun Heo Cc: Jens Axboe , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-api@vger.kernel.org, Jonathan Corbet , Serge Hallyn , "Rafael J. Wysocki" , "David S. Miller" , Saravana Kannan , Jan Kara , David Howells , Seth Forshee , David Rheinsberg , Tom Gundersen , Christian Kellner , Dmitry Vyukov , =?utf-8?B?U3TDqXBoYW5l?= Graber , linux-doc@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH 5/8] kernfs: let objects opt-in to propagating from the initial namespace Message-ID: <20200413193950.tokh5m7wsyrous3c@wittgenstein> References: <20200408152151.5780-1-christian.brauner@ubuntu.com> <20200408152151.5780-6-christian.brauner@ubuntu.com> <20200413190239.GG60335@mtj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200413190239.GG60335@mtj.duckdns.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 13, 2020 at 03:02:39PM -0400, Tejun Heo wrote: > Hello, > > On Wed, Apr 08, 2020 at 05:21:48PM +0200, Christian Brauner wrote: > > The initial namespace is special in many ways. One feature it always has > > had is that it propagates all its devices into all non-initial > > namespaces. This is e.g. true for all device classes under /sys/class/ > > Maybe I'm missing your point but I've always thought of it the other way > around. Some namespaces make all objects visible in init_ns so that all > non-init namespaces are subset of the init one, which sometimes requires > creating aliases. Other namespaces don't do that. At least in my experience, > the former is a lot easier to administer. > > The current namespace support in kernfs behaves the way it does because the > only namespace it supports is netns, but if we're expanding it, I think it > might be better to default to init_ns is superset of all others model and make > netns opt for the disjointing behavior. Hey Tejun, The point was that devices have always been shown in all namespaces. You can see all devices everywhere. Sure that wasn't ideal but we can't really change that behavior since it would break userspace significantly as a lot of tools are used to that behavior. Another problem is that you might have two devices of the same class with the same name that belong to different namespaces and if you shown them all in the initial namespace you get clashes. This was one of the original reasons why network devices are only shown in the namespace they belong to but not in any other. The network model of only showing the device in the namespace they belong to also has the advantage that tools do not stomp on each others feet when using them.