linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lennart Poettering <mzxreary@0pointer.de>
To: Christian Brauner <christian.brauner@ubuntu.com>
Cc: David Howells <dhowells@redhat.com>,
	torvalds@linux-foundation.org, viro@zeniv.linux.org.uk,
	dray@redhat.com, kzak@redhat.com, mszeredi@redhat.com,
	swhiteho@redhat.com, jlayton@redhat.com, raven@themaw.net,
	andres@anarazel.de, keyrings@vger.kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	cyphar@cyphar.com
Subject: Re: Upcoming: Notifications, FS notifications and fsinfo()
Date: Tue, 31 Mar 2020 09:22:24 +0200	[thread overview]
Message-ID: <20200331072224.GA27062@gardel-login> (raw)
In-Reply-To: <20200330211700.g7evnuvvjenq3fzm@wittgenstein>

On Mo, 30.03.20 23:17, Christian Brauner (christian.brauner@ubuntu.com) 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,
> and safe delegation through fds. Another heavy user of this would be
> systemd (Cced Lennart who I've discussed this with) which would prefer
> the fd-based approach as well. I think pulling this into a filesystem
> and making userspace parse around in a filesystem tree to query mount
> information is the wrong approach and will get messy pretty quickly
> especially in the face of mount and user namespace interactions and
> various other pitfalls. fsinfo() fits quite nicely with the all-fd-based
> approach of the whole mount api. So yes, definitely preferred from my
> end.

Christian is right. I think it's very important to have an API that
allows to query the state of fs attributes in a consistent state,
i.e. so that the attributes userspace is interested in can be queried
in a single call, so they all describe the very same point in
time. Distributing attributes onto multiple individual files just
sucks, because it's then guaranteed that you never can read them in a
way they actually fit together, some attributes you read will be
older, others newer. It's a big design flaw of sysfs (which is
structured like this) if you ask me.

I don't really care if the kernel API for this is binary or
textual. Slight preference for binary, but I don't care too much.

I think it would be wise to bind such APIs to fds, simply because it
always works. Doing path based stuff sucks, because you always need to
mount stuff and have a path tree set up, which is less ideal in a
world where namespacing is common, and namespaces are a shared concept
(at least with your other threads, if not with other processes). As a
maintainer of an init system I really dislike APIs that I can only use
after a mount structure has been set up, too often we want to do stuff
before that. Moreover, philosophically I find it questionnable to use
path based APIs to interface with the path object hierarchy itself. it
feels "too recursive". Just keep this separate: build stuff on top of
the fs that fits on top of the fs, but don't build fs APIs on top of
fs APIs that stem from the same layer.

Summary: atomic APIs rock, fd-based APIs rock. APIs built on
individual files one can only read individually suck. APIs of the path
layer exposed in the path layer suck.

Hope this makes some sense?

Lennart

  parent reply	other threads:[~2020-03-31  7:28 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-30 13:58 Upcoming: Notifications, FS notifications and fsinfo() David Howells
2020-03-30 14:31 ` [GIT PULL] General notification queue and key notifications David Howells
2020-03-31  6:51   ` Stephen Rothwell
2020-03-30 14:36 ` [GIT PULL] Mount and superblock notifications David Howells
2020-04-04 21:13   ` Linus Torvalds
2020-04-05 22:52     ` Andres Freund
2020-03-30 14:43 ` [GIT PULL] fsinfo: Filesystem information query David Howells
2020-03-30 20:28 ` Upcoming: Notifications, FS notifications and fsinfo() Miklos Szeredi
2020-03-31  9:21   ` Karel Zak
2020-03-30 21:17 ` Christian Brauner
2020-03-31  5:11   ` Miklos Szeredi
2020-03-31  8:15     ` Christian Brauner
2020-03-31  8:34       ` Miklos Szeredi
2020-03-31  8:34     ` Karel Zak
2020-03-31  8:56       ` Miklos Szeredi
2020-03-31  9:49         ` Karel Zak
2020-03-31 12:25         ` Lennart Poettering
2020-03-31 15:10           ` Miklos Szeredi
2020-03-31 15:24             ` Lennart Poettering
2020-03-31 21:56         ` David Howells
2020-03-31 21:54     ` David Howells
2020-04-01  8:43       ` Karel Zak
2020-03-31  7:22   ` Lennart Poettering [this message]
2020-03-31 17:31 ` David Howells
2020-03-31 19:42   ` Miklos Szeredi
2020-03-31 19:47   ` David Howells
2020-03-31 21:14   ` David Howells
2020-03-31 21:23   ` David Howells
2020-03-31 21:52 ` David Howells
2020-04-01  9:04   ` Karel Zak
2020-04-01 13:34     ` Miklos Szeredi
2020-04-01 13:55     ` David Howells
2020-04-01 13:58     ` David Howells
2020-04-01 15:25       ` Miklos Szeredi
2020-04-03  9:11         ` Karel Zak
2020-04-01 16:01       ` David Howells
2020-04-01 16:30         ` Miklos Szeredi
2020-04-02 15:22         ` David Howells
2020-04-02 15:24           ` Miklos Szeredi
2020-04-02 15:42           ` David Howells
2020-04-02 15:24         ` David Howells
2020-04-01 14:41   ` Lennart Poettering
2020-04-01 15:33     ` Miklos Szeredi
2020-04-01 16:06     ` David Howells
2020-04-01 16:40       ` Miklos Szeredi
2020-04-02  2:52         ` Ian Kent
2020-04-02 13:52           ` Miklos Szeredi
2020-04-02 14:36             ` Lennart Poettering
2020-04-02 15:22               ` Miklos Szeredi
2020-04-02 15:28                 ` Lennart Poettering
2020-04-02 15:35                   ` Miklos Szeredi
2020-04-02 15:50                     ` Lennart Poettering
2020-04-02 17:20                       ` Miklos Szeredi
2020-04-03 11:08                         ` Lennart Poettering
2020-04-03 11:48                           ` Miklos Szeredi
2020-04-03 15:01                             ` Lennart Poettering
2020-04-06  9:22                               ` Miklos Szeredi
2020-04-06 17:29                                 ` Lennart Poettering
2020-04-07  2:21                                   ` Ian Kent
2020-04-07 13:59                                     ` Miklos Szeredi
2020-04-07 15:53                                       ` Lennart Poettering
2020-04-07 16:06                                         ` Miklos Szeredi
2020-04-02 15:51                 ` David Howells
2020-04-02 15:56                 ` David Howells
2020-04-03  1:44             ` Ian Kent
2020-04-03 11:11               ` Lennart Poettering
2020-04-03 11:38                 ` Miklos Szeredi
2020-04-03 12:05                   ` Richard Weinberger
2020-04-03 15:12                   ` Lennart Poettering
2020-04-03 20:30                     ` J. Bruce Fields
2020-04-06  8:35                       ` Miklos Szeredi
2020-04-06 16:07                         ` J. Bruce Fields
2020-04-06  9:17                       ` Karel Zak
2020-04-06 16:34                         ` Linus Torvalds
2020-04-06 18:46                           ` J. Bruce Fields
2020-04-06 18:48                           ` Lennart Poettering
2020-04-08  3:36                             ` Linus Torvalds
2020-04-03 15:36                   ` David Howells
2020-04-03 15:41                     ` Lennart Poettering

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200331072224.GA27062@gardel-login \
    --to=mzxreary@0pointer.de \
    --cc=andres@anarazel.de \
    --cc=christian.brauner@ubuntu.com \
    --cc=cyphar@cyphar.com \
    --cc=dhowells@redhat.com \
    --cc=dray@redhat.com \
    --cc=jlayton@redhat.com \
    --cc=keyrings@vger.kernel.org \
    --cc=kzak@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mszeredi@redhat.com \
    --cc=raven@themaw.net \
    --cc=swhiteho@redhat.com \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).