Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3278808ybb; Tue, 31 Mar 2020 01:57:36 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt3rxnQchpEH2oA15p0ZsWO3QCGdHIMs2C0QcEB6t+pfdOSQ3ZbNhjLoSHs3MuHERCJyVQO X-Received: by 2002:a4a:d44d:: with SMTP id p13mr12555245oos.5.1585645056755; Tue, 31 Mar 2020 01:57:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585645056; cv=none; d=google.com; s=arc-20160816; b=RD+jJgJjPznBlP51GGbw3xSZPKr3Scbn4yilyYGbVKYTRdQeWF/YKpqJHjiJtvYsm6 jkuFUA+h6DPJqbRGfn83A4nGSlanPFOVbwSA/PgT02c4Z3tL8vcQt4hRQwL5W+a5h6it flaAcWq3ljvLy9w/Ze11yWFF3pOeZ9yiMSlmTlH9gbhsFGc4rN3yBUEAuK+9PcgPpjXW DqU+VVxMmp5Y9LQh0IxKjEGdYH42sRYgOlgoReRELu0mXiOxO+yqCejw3Ymy/PpEHuxF 7PT3Syge1AEXl3zBdQLb7kmqtM9vBCkVrz7yPIBDAUweong3/EtbvCXBGTyLHGII8QvF wC8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=naz5vFiOyfqlYWnFE99McWHBp3JuwM6PJW7GvvgW6Cc=; b=L05LWdbrr2u0qLgvZAbPk0RMlxDEycfIHuR2x+NWhuQWmMJO0R6pwwduYQ/JwHnO/V y785KH4tpMyH1YCB1ZJ3j4Vwz9BOja3HREmFjow0TlEAYEMA6XNVZy1zRxQFU6OEgNk3 ZBDLXMeE6HWTGGH9FInLiWqcvMVDWX99NJloVVL4ZDr8MVNSd/zxwukI2gRmpcFiTKYv Ut4JZXKMW2QVBmMC11mJKxRiLnaqWfaig7p31RvRflhQPBUWLkdWoMj2ajYwl3eMymNL zhMv+yZfZkebrWtwRfwBUqSwzMwHlOMhAXVVdDmaL47y9UagHPHnTAtrBSF1nMpJuVyk D8Mg== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=SRrMxw42; 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 c67si7429275oif.5.2020.03.31.01.57.24; Tue, 31 Mar 2020 01:57:36 -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; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=SRrMxw42; 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 S1730292AbgCaI4s (ORCPT + 99 others); Tue, 31 Mar 2020 04:56:48 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:41314 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730161AbgCaI4s (ORCPT ); Tue, 31 Mar 2020 04:56:48 -0400 Received: by mail-ed1-f68.google.com with SMTP id v1so24148077edq.8 for ; Tue, 31 Mar 2020 01:56:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=naz5vFiOyfqlYWnFE99McWHBp3JuwM6PJW7GvvgW6Cc=; b=SRrMxw42id0lcjITOkFTm2e3NqOUSpRQCBgX9s9jnPN2a4QIoRIquUmMdmA0BMf4Xp U9VQN9PleCKPt5lfXlorjcO0kIf7U2qTLno3a5/zbtdGi6/2rue+eSwXvWzUkQQ0e/+T wx6QHGfcYE219bRqR+z8DEBh5rBLCib4PDNcg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=naz5vFiOyfqlYWnFE99McWHBp3JuwM6PJW7GvvgW6Cc=; b=MwbZBygwphHWh9lU0vMqfpfFTTGlsNneAU5OkfAvWW1vcy+eowAXCiTPcglC4FpC/9 DwB7mbr/HslBfRjRHtEQguqDle2wLZC0M+ykY/nNbhT3GuARqsaVcdirtReAPXBUUA3D Du9c8Hn77jj/5oOgGkvlkqFnM0RP0l61zQhz8TTLJckNFS9/c+BrxcLs0mj03utdEuGq lrOvOpX9SkCG1RTNTvsXD1L0S1QOYwGXSPa9C1QuGq4OLqj66hGDKK/z4Do3JM//KyDz QeUx/VrIy9/Fnpe8AMIfMooWJZhOdEzU3ypKTKQejMllKQ6g85evvRcacwlD6Kd6ldYA rT9w== X-Gm-Message-State: ANhLgQ2lKlgVSajZMwlwru5davJAR+hoI1vGrPP3VHgEvocMwx8wIIYE yJx68qcsSeSdrafVi7KyqiUCEbNmendnbjHqeiexug== X-Received: by 2002:a17:906:848d:: with SMTP id m13mr14671902ejx.348.1585645006637; Tue, 31 Mar 2020 01:56:46 -0700 (PDT) MIME-Version: 1.0 References: <1445647.1585576702@warthog.procyon.org.uk> <20200330211700.g7evnuvvjenq3fzm@wittgenstein> <20200331083430.kserp35qabnxvths@ws.net.home> In-Reply-To: <20200331083430.kserp35qabnxvths@ws.net.home> From: Miklos Szeredi Date: Tue, 31 Mar 2020 10:56:35 +0200 Message-ID: Subject: Re: Upcoming: Notifications, FS notifications and fsinfo() To: Karel Zak Cc: 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, Lennart Poettering , Aleksa Sarai Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. - util linux needs to display the topology and state of mounts in the system that corresponds to a consistent state that set of mounts - etc... From that we can derive a set of requirements for the API. Thanks, Miklos