Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3590985ybb; Tue, 31 Mar 2020 08:12:24 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuTo3cFjdMS2f1s5BTWlZ5BDBN9+OuXu1lC/o6dU8QvtNgdn5HOcRZqudBuO0r1/FeG/ILK X-Received: by 2002:aca:5403:: with SMTP id i3mr2498113oib.174.1585667543928; Tue, 31 Mar 2020 08:12:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585667543; cv=none; d=google.com; s=arc-20160816; b=FSo21RDDFpX0gJP90BGOVmhbzLCX2M/g3ijNMmIJSRzzuQKQs6qZDX9A3ylE8BN7Oz r1e7vyCY6ZWWwOJQBxvfBbJEJMzgf3aVovKTZmCr6YcOzE4PrFmmc+0wcnEGEi3ZS63/ egKLFIzyiPdpAiDpPSbu0sumAvkTQXse75VFNC+DbQ6uRuYPL0zFjx/+mUgfk4Cq0Ase +qhliu7GO46euUTSm0rn5Ukvyvg2lvgqfSg2bGoz6OIstKudYUs3InfjDA0OKLyzD/KI AlSWVN6XC/ZbQmkFEm9uw2MQ2gXjVPGV2arZCpp5BUZMQeDpbJMALJy6OHe8ev8MU/zj CqCw== 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=x7MnP0ziMJ05b/KxlP+M8bkph/ifpBLqQViGWOB4DEo=; b=XdhPHrKWKePSX0ugIQ0BL77BCTxKkluOXWRTKoQdSxkUPnHhwKhSkNKqsyQ3M3hmdA Vq0axHHQNxbybYyyPTn2AVeWEZiHcYdYs5RHE3JGqpEsD9NBSrFCcZJ+iOD7qxW/5Hgx RmEWJxAYVu8lhwzx30mnEMX06oiOW8W3lbfAV7jepeQsSHT+laTzBUStN8e8m/Sr8YgV SEQECQIe+hEaSnmugEI6hmXL6NBdzG4I7nAYKLUrNhH3V4bsAadNQ3vfQZ0pQMgu+OjE 8ekd8r4j2QXKRPJMp82W8i7IhhBn2ZFy3WYzJnQHyMb3+hsUeA17AfwLg5YKIcowPQ4Q ZPoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=SSt1VrIV; 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 a69si7203910oib.90.2020.03.31.08.12.00; Tue, 31 Mar 2020 08:12:23 -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=SSt1VrIV; 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 S1730727AbgCaPKs (ORCPT + 99 others); Tue, 31 Mar 2020 11:10:48 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:46713 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730592AbgCaPKs (ORCPT ); Tue, 31 Mar 2020 11:10:48 -0400 Received: by mail-ed1-f67.google.com with SMTP id cf14so25527946edb.13 for ; Tue, 31 Mar 2020 08:10:46 -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=x7MnP0ziMJ05b/KxlP+M8bkph/ifpBLqQViGWOB4DEo=; b=SSt1VrIVX/Tjp7n2tm5hZ28Rimha6AkiiRqswnMUOZrX6u8JAvs7EpidlIibrDgWn6 8f3oR+MSicBlmRwxRGlRmocZLP58QcOxLLy/3P8XMGN78DlSS3Yc9BcLygTC477mg5aR 2bw79UepxHWGRmpmqa2topzKhKBf6CZHFQB5A= 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=x7MnP0ziMJ05b/KxlP+M8bkph/ifpBLqQViGWOB4DEo=; b=RXC/hxSpy+WH8hY1xzkbYQnOBRFpCcbkmX6jHZXXgF+AIAF7jaQhJkRsAbjEJOyXx0 z4YhwOR1lq5m2/vuTlEWRNY8ekgwXNtqPHAE2Onvu47FO6zk1V5L4fKyhWkwdydt3nFj ZMF0IYJ62T7sPGi/RsHO4FPXqYFpn+NDRlTLpuhcqxnDLzxtHBA/mtHqac0ceIi+q9A+ tlF5JmvN203i00DhBNt6VWjeIaKzQBd4Cz75Q/0J0/k8nyWKZS+fECs0dwIPMxXjZ+GV yaDTiAUVRQlbZ0rU7HIwah85J6MZHpBJbMIe/0JlR3w6XPXGEm5VZHjXe1zEUBjO3LsF wEhg== X-Gm-Message-State: ANhLgQ35+vzF4GVe3EdiUTrGO8OjvyZ5hxD/vEQSQf4njXgg7ZCMytPI +uueP8Bcx8iVG+AcI50UeLF1gMlAxeOidhYFCe567A== X-Received: by 2002:a17:906:6545:: with SMTP id u5mr7087508ejn.27.1585667445614; Tue, 31 Mar 2020 08:10:45 -0700 (PDT) MIME-Version: 1.0 References: <1445647.1585576702@warthog.procyon.org.uk> <20200330211700.g7evnuvvjenq3fzm@wittgenstein> <20200331083430.kserp35qabnxvths@ws.net.home> <20200331122554.GA27469@gardel-login> In-Reply-To: <20200331122554.GA27469@gardel-login> From: Miklos Szeredi Date: Tue, 31 Mar 2020 17:10:34 +0200 Message-ID: Subject: Re: Upcoming: Notifications, FS notifications and fsinfo() To: Lennart Poettering 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 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 2:25 PM Lennart Poettering wrote: > > 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), Recursive remount-ro is clear. What is not clear is whether you need to do this for hidden mounts (not possible from userspace without a way to disable mount following on path lookup). Would it make sense to add a kernel API for recursive setting of mount flags? What exactly is this unmount with filters? Can you give examples? > - 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. Okay. Thanks, Miklos