Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3440462ybb; Tue, 31 Mar 2020 05:26:45 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvy6SDCG4hWtgwj0nAuKHAwDntuX+82GU2q9xtfOyGV4+bVsmaVOQwARGghIuOwpZkGv6l7 X-Received: by 2002:aca:c6ca:: with SMTP id w193mr1768531oif.165.1585657605412; Tue, 31 Mar 2020 05:26:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585657605; cv=none; d=google.com; s=arc-20160816; b=dSIeiMbUbfjjPxwbgVK4h0k7RmXOt6HHSLk9sM+RwCfLGKQJy1L5U1ZdVGa72klxR/ 0rZiwA7bSq7/GGFqK/D3QVvvLUPBSBeksQwgMufGbeW7XX2V6kmXLzfHazhjsbPRBMid fhgH2ZefoPOcwyEaCq/hY6EKFIMnpabClHEdNCGcmOMqKT15IGPh+5k+1cg/QByPu63o 54E7H3yV+UQ7u50oTFms3Chl99iZZkEYEmAHKRZfrvSUt4ffZtxmXkjAIiVx+Qsv+q2B XyqLGFK/GOrI3XFNoADWWnI2FR/zHZEmziCSrcpfX0fjqy2HtjbUxCTTRWt5+oDHP+zp CF2w== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=SbpvTvqjdHnFfbmMYPdGXaa6qyaof0VHU/7g+T0ABD0=; b=HOsoQDheP8EqXcVQbRPkZy3DAcuHE1qKFlNpxlKAgF2UDhnF1t3DGk/tV5OPttTmXA GQf5iNjZWgtwoIzkBuZxbWW6LF6wV5H0dvadbqGV7yWiUevsQ1vFrb3lmEq1++ZSFRdj hOYMtQm0/aPafTJQCZ1MaBbi55L0YDyS7lr2f67OwfBQMofetcviHx1Qm9r1DDdqLB0c ZcobLf2n3c/sGxpONaESXGw3ljtYe7LV6NNu0iV0P/XJAXFmTFSwqcV9j2ca4uCbK40R DSGlqnv8J4s7Zo0WEc+I07IejRvf9RULSDCRJKovuIiQivye6M+GaRI6crVAzJo4vps5 IRnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d185si7034398oif.234.2020.03.31.05.26.33; Tue, 31 Mar 2020 05:26:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730776AbgCaMZ6 (ORCPT + 99 others); Tue, 31 Mar 2020 08:25:58 -0400 Received: from gardel.0pointer.net ([85.214.157.71]:48496 "EHLO gardel.0pointer.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730343AbgCaMZ5 (ORCPT ); Tue, 31 Mar 2020 08:25:57 -0400 Received: from gardel-login.0pointer.net (gardel.0pointer.net [85.214.157.71]) by gardel.0pointer.net (Postfix) with ESMTP id 4402FE814E3; Tue, 31 Mar 2020 14:25:55 +0200 (CEST) Received: by gardel-login.0pointer.net (Postfix, from userid 1000) id CBD63160704; Tue, 31 Mar 2020 14:25:54 +0200 (CEST) Date: Tue, 31 Mar 2020 14:25:54 +0200 From: Lennart Poettering To: Miklos Szeredi Cc: Karel Zak , Christian Brauner , David Howells , Linus Torvalds , Al Viro , dray@redhat.com, Miklos Szeredi , Steven Whitehouse , Jeff Layton , Ian Kent , andres@anarazel.de, keyrings@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Aleksa Sarai Subject: Re: Upcoming: Notifications, FS notifications and fsinfo() Message-ID: <20200331122554.GA27469@gardel-login> References: <1445647.1585576702@warthog.procyon.org.uk> <20200330211700.g7evnuvvjenq3fzm@wittgenstein> <20200331083430.kserp35qabnxvths@ws.net.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Di, 31.03.20 10:56, Miklos Szeredi (miklos@szeredi.hu) wrote: > On Tue, Mar 31, 2020 at 10:34 AM Karel Zak wrote: > > > > On Tue, Mar 31, 2020 at 07:11:11AM +0200, Miklos Szeredi wrote: > > > On Mon, Mar 30, 2020 at 11:17 PM Christian Brauner > > > wrote: > > > > > > > Fwiw, putting down my kernel hat and speaking as someone who maintains > > > > two container runtimes and various other low-level bits and pieces in > > > > userspace who'd make heavy use of this stuff I would prefer the fd-based > > > > fsinfo() approach especially in the light of across namespace > > > > operations, querying all properties of a mount atomically all-at-once, > > > > > > fsinfo(2) doesn't meet the atomically all-at-once requirement. > > > > I guess your /proc based idea have exactly the same problem... > > Yes, that's exactly what I wanted to demonstrate: there's no > fundamental difference between the two API's in this respect. > > > I see two possible ways: > > > > - after open("/mnt", O_PATH) create copy-on-write object in kernel to > > represent mount node -- kernel will able to modify it, but userspace > > will get unchanged data from the FD until to close() > > > > - improve fsinfo() to provide set (list) of the attributes by one call > > I think we are approaching this from the wrong end. Let's just > ignore all of the proposed interfaces for now and only concentrate on > what this will be used for. > > Start with a set of use cases by all interested parties. E.g. > > - systemd wants to keep track attached mounts in a namespace, as well > as new detached mounts created by fsmount() > > - systemd need to keep information (such as parent, children, mount > flags, fs options, etc) up to date on any change of topology or > attributes. - We also have code that recursively remounts r/o or unmounts some directory tree (with filters), which is currently nasty to do since the relationships between dirs are not always clear from /proc/self/mountinfo alone, in particular not in an even remotely atomic fashion, or when stuff is overmounted. - We also have code that needs to check if /dev/ is plain tmpfs or devtmpfs. We cannot use statfs for that, since in both cases TMPFS_MAGIC is reported, hence we currently parse /proc/self/mountinfo for that to find the fstype string there, which is different for both cases. Lennart -- Lennart Poettering, Berlin