Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp704917pxa; Tue, 11 Aug 2020 12:55:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgWuVZo75HvarTnsdFt/nI0JQEBNUmzQMtzjVU66NyMCImZd6WeHiEVXAm+WVWtaJdKz8d X-Received: by 2002:a05:6402:a5b:: with SMTP id bt27mr28347629edb.120.1597175711443; Tue, 11 Aug 2020 12:55:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597175711; cv=none; d=google.com; s=arc-20160816; b=LZ+SBtTKxkRuhY431xSMZDFf8lOAUkbtVX+hlgN130mTNmrBs/c258dx9VoJLgmQvm nEWQ7foxVkVju/WVNPAubqs7/bPHWmmlcpUQi09wBIfrWq6fTJZa93h+c30M6JsOsg2x yX4mypH1IoGdn7RrKsWbg8GyNeqdobXZb60WZ0TjstZmj8D6ii7ogohJNgoRCoNKnVeN mzZgsFZ2tbpPG8Pz5nw750I92ws5IftatQHgngjdSa0HYOzV/zxMQjQSPv/2EtV2VNJi CxAaMN9wlb3OG6awUaEgCJ9nzuc3gY27nryS0qbMpeVAzokBCrguCwV9n9iUSvqfIN25 BNVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=SsEpJFvgKmcJelakUdtV9wvrQ7hnDVyG9BkWjck+jb0=; b=Gam6oh/dV+Y6QeupdQ6MFLf2psKhYHg5aalaS9OiOHdEmrhEVP51JDas0s6r4y3hh/ EE0RSU/uaUG6c7V42BxdFeOgNSjSpTuesDweMUsceQYoZr2XMHlEyzxXp9F6DGnHta0b OtyV4CTilz2GmSecC4ZjDwJ9H65NeiXZc8RtU+0BgBmRL7m2kfRTgMuWqjGOqgE/RJ/v 6fLZPNowpmKT5olYyxzU9Nx8S11Waa8p6Bzz3lnpk5eNycowZ5+bw7xzhvRtUSIj3rji a28WRSW1RAaA8jmN6VQeaBC8jZv+jQDJLtFVifsoeYpxNSV79osruNj6UB+52Wo0etLf vPdA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qx20si13203291ejb.489.2020.08.11.12.54.48; Tue, 11 Aug 2020 12:55:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726630AbgHKTuf (ORCPT + 99 others); Tue, 11 Aug 2020 15:50:35 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:54056 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726173AbgHKTue (ORCPT ); Tue, 11 Aug 2020 15:50:34 -0400 Received: from ip5f5af08c.dynamic.kabel-deutschland.de ([95.90.240.140] helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1k5aI2-0002GB-Ig; Tue, 11 Aug 2020 19:50:30 +0000 Date: Tue, 11 Aug 2020 21:50:29 +0200 From: Christian Brauner To: Lennart Poettering Cc: Miklos Szeredi , Linus Torvalds , linux-fsdevel , David Howells , Al Viro , Karel Zak , Jeff Layton , Miklos Szeredi , Nicolas Dichtel , Christian Brauner , Linux API , Ian Kent , LSM , Linux Kernel Mailing List Subject: Re: file metadata via fs API (was: [GIT PULL] Filesystem Information) Message-ID: <20200811195029.cnowfkikr2xajhgo@wittgenstein> References: <20200811135419.GA1263716@miu.piliscsaba.redhat.com> <20200811193105.GA228302@gardel-login> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200811193105.GA228302@gardel-login> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 11, 2020 at 09:31:05PM +0200, Lennart Poettering wrote: > On Di, 11.08.20 20:49, Miklos Szeredi (miklos@szeredi.hu) wrote: > > > On Tue, Aug 11, 2020 at 6:05 PM Linus Torvalds > > wrote: > > > > > and then people do "$(srctree)/". If you haven't seen that kind of > > > pattern where the pathname has two (or sometimes more!) slashes in the > > > middle, you've led a very sheltered life. > > > > Oh, I have. That's why I opted for triple slashes, since that should > > work most of the time even in those concatenated cases. And yes, I > > know, most is not always, and this might just be hiding bugs, etc... > > I think the pragmatic approach would be to try this and see how many > > triple slash hits a normal workload gets and if it's reasonably low, > > then hopefully that together with warnings for O_ALT would be enough. > > There's no point. Userspace relies on the current meaning of triple > slashes. It really does. > > I know many places in systemd where we might end up with a triple > slash. Here's a real-life example: some code wants to access the > cgroup attribute 'cgroup.controllers' of the root cgroup. It thus > generates the right path in the fs for it, which is the concatenation of > "/sys/fs/cgroup/" (because that's where cgroupfs is mounted), of "/" > (i.e. for the root cgroup) and of "/cgroup.controllers" (as that's the > file the attribute is exposed under). > > And there you go: > > "/sys/fs/cgroup/" + "/" + "/cgroup.controllers" → "/sys/fs/cgroup///cgroup.controllers" > > This is a real-life thing. Don't break this please. Taken from a log from a container: lxc f4 20200810105815.742 TRACE cgfsng - cgroups/cgfsng.c:cg_legacy_handle_cpuset_hierarchy:552 - "cgroup.clone_children" was already set to "1" lxc f4 20200810105815.742 WARN cgfsng - cgroups/cgfsng.c:mkdir_eexist_on_last:1152 - File exists - Failed to create directory "/sys/fs/cgroup/cpuset///lxc.monitor.f4" lxc f4 20200810105815.743 INFO cgfsng - cgroups/cgfsng.c:cgfsng_monitor_create:1366 - The monitor process uses "lxc.monitor.f4" as cgroup lxc f4 20200810105815.743 DEBUG storage - storage/storage.c:get_storage_by_name:211 - Detected rootfs type "dir" lxc f4 20200810105815.743 TRACE cgfsng - cgroups/cgfsng.c:cg_legacy_handle_cpuset_hierarchy:552 - "cgroup.clone_children" was already set to "1" lxc f4 20200810105815.743 WARN cgfsng - cgroups/cgfsng.c:mkdir_eexist_on_last:1152 - File exists - Failed to create directory "/sys/fs/cgroup/cpuset///lxc.payload.f4" lxc f4 20200810105815.743 INFO cgfsng - cgroups/cgfsng.c:cgfsng_payload_create:1469 - The container process uses "lxc.payload.f4" as cgroup lxc f4 20200810105815.744 TRACE start - start.c:lxc_spawn:1731 - Spawned container directly into target cgroup via cgroup2 fd 17 Christian