Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp122970pxa; Tue, 4 Aug 2020 18:34:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPECZbMLHiSruR3cyZYIVsS6pOO3r4onQXHlt6G0hCo3+B3/UWioRNDefExShjh/OzNhdb X-Received: by 2002:a17:906:16c8:: with SMTP id t8mr902654ejd.484.1596591291074; Tue, 04 Aug 2020 18:34:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596591291; cv=none; d=google.com; s=arc-20160816; b=QjYimk0UmnJR1+e44kTvOsJpC1dEeP88RumkXenEFe57Wo7TmALq+Ji3Bnk9tYoEBs Qt1XoJ3cmP/UiXSTD9F9yYmao+isO5R2LEq4OlKexKSXujYevL7d45mMIdPs0DuGatTp AX5gvdlGOBtl/f4vzWOUn48ydKYoPG0KgGywBow8h/MM2V89mTRO5XoTlsU2/y22vS5B 7UV4KySQaKynBeUCY8gK96cqYR8j62/dMVwxGtlOodjWEI3vW/rB+4+RfoI8VaJiFulb 2Tvzj8vgnRYO0piaJMma9EdmQqfBK9Pn8Lm4Ze2R7myayPqy7WamvfqtT2GQPueC5maz o9Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature:dkim-signature; bh=FgynrCS35t+Bb0YX8gjfGwWuq/yMZ4J2VELd+N8H7BI=; b=sUW1htIxw7i2TkH4MeCRiy8Ee0aC5yzFB3JBB2ki93yIzTIGKXaSirsxHM5Jh27K/i 1aLYkYSTIWg7ceUelMD6lDRhgWe9X45pHwa2wEZjEtFTlmajkDpA768N67jbAW6ZRhHg DyDiL7pRoxlLmu1NOv56YuPYojvs52nGegb1e7eTx8iF4zHiWgiPE4plqK6senSPI+jc q0rxx1XMCkFlpoKzRDBKPjEEByL0Wi0DpyHC3XycEZeFsLCUNMf3ZcHnF1k+j1a3TaQ0 K+G75wSqvDeu0mP0HrjsZAy9n6O/qyMTGAYRqDX/8nGRWcI7RR6Ig293QIOvjApkoHrT 8I5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@themaw.net header.s=fm3 header.b=ETmZ1Yaj; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=GC+il859; 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 w13si303503eds.493.2020.08.04.18.34.28; Tue, 04 Aug 2020 18:34:51 -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; dkim=pass header.i=@themaw.net header.s=fm3 header.b=ETmZ1Yaj; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=GC+il859; 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 S1726305AbgHEBd4 (ORCPT + 99 others); Tue, 4 Aug 2020 21:33:56 -0400 Received: from wnew1-smtp.messagingengine.com ([64.147.123.26]:47787 "EHLO wnew1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725863AbgHEBdz (ORCPT ); Tue, 4 Aug 2020 21:33:55 -0400 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.west.internal (Postfix) with ESMTP id ECBB9C6C; Tue, 4 Aug 2020 21:33:53 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 04 Aug 2020 21:33:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=themaw.net; h= message-id:subject:from:to:cc:date:in-reply-to:references :content-type:mime-version:content-transfer-encoding; s=fm3; bh= FgynrCS35t+Bb0YX8gjfGwWuq/yMZ4J2VELd+N8H7BI=; b=ETmZ1YajbBIgESVe Ua4pz7szM2WGYY5v4Cu+mrMf7ztyifMqPrdnjWj/LAAsF+8bsoj3Nn84EZDLrWIk L0ToE3TMG44ne4l1NiLSKISNJDM5pZeZMwKLJIiTl6hP5Cd5aABfslWSx6F+h6Ex r7zPEe8efX0kNHDh5D6wIg7xjbLAnynkN5968NzlkTP+jzIMwa7v5PW1kBJD3sUz de3icdVla3m1oJstQdU6VvNIvzUcPLspndSbQcGZ73ymkz158/goA4wlUgQSEd6Q Ny8GPVp3ca9KDxLeKn9CePrNn0SLmdoRc2n0xo3xlIvvmxyIdToE0xms5JF3GRPh bN1iEw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=FgynrCS35t+Bb0YX8gjfGwWuq/yMZ4J2VELd+N8H7 BI=; b=GC+il859d8TmcV47HgpBL9N46aRTHV+7XxGjkgOjmHOyIZkwNW57N/B75 zUwplzERnMRetwNDh6YOT0NkH5zFSVU0vC6UlP6vlCUW3hy2f9+sNkfJL52+PNL2 qELkH7mXxFa5CdH9DjZBNjqp0hhljEKgTFTbesHZFB+RNw+O3YUzN4zdS91cAx09 bYLIJiQAQKP+dpTF1l4pLjF7Uu9Eg2Tghw5z7aCcw3iPgV1J/kqJsTmx1CKNTlVi GdQQEIV3OPiCuZ4iHPJtyMilAAsGnq4E/kJYN64976YSLNgWLAT0vn3FaKhFW3Ex KokPW+xvg5DusY8VuXPVWuONg/dBw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrjeejgdeglecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkuffhvfffjghftggfggfgsehtkeertddtreejnecuhfhrohhmpefkrghnucfm vghnthcuoehrrghvvghnsehthhgvmhgrfidrnhgvtheqnecuggftrfgrthhtvghrnhepgf elleekteehleegheeujeeuudfhueffgfelhefgvedthefhhffhhfdtudfgfeehnecukfhp peehkedrjedrvdehhedrvddvtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehrrghvvghnsehthhgvmhgrfidrnhgvth X-ME-Proxy: Received: from mickey.themaw.net (58-7-255-220.dyn.iinet.net.au [58.7.255.220]) by mail.messagingengine.com (Postfix) with ESMTPA id E351930600B2; Tue, 4 Aug 2020 21:33:47 -0400 (EDT) Message-ID: Subject: Re: [GIT PULL] Filesystem Information From: Ian Kent To: Miklos Szeredi Cc: David Howells , Linus Torvalds , Al Viro , Karel Zak , Jeff Layton , Miklos Szeredi , Nicolas Dichtel , Christian Brauner , Lennart Poettering , Linux API , linux-fsdevel@vger.kernel.org, LSM , linux-kernel@vger.kernel.org Date: Wed, 05 Aug 2020 09:33:44 +0800 In-Reply-To: References: <1842689.1596468469@warthog.procyon.org.uk> <1845353.1596469795@warthog.procyon.org.uk> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.34.4 (3.34.4-1.fc31) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2020-08-04 at 16:36 +0200, Miklos Szeredi wrote: > On Tue, Aug 4, 2020 at 4:15 AM Ian Kent wrote: > > On Mon, 2020-08-03 at 18:42 +0200, Miklos Szeredi wrote: > > > On Mon, Aug 3, 2020 at 5:50 PM David Howells > > > > > > wrote: > > > > Hi Linus, > > > > > > > > Here's a set of patches that adds a system call, fsinfo(), that > > > > allows > > > > information about the VFS, mount topology, superblock and files > > > > to > > > > be > > > > retrieved. > > > > > > > > The patchset is based on top of the mount notifications > > > > patchset so > > > > that > > > > the mount notification mechanism can be hooked to provide event > > > > counters > > > > that can be retrieved with fsinfo(), thereby making it a lot > > > > faster > > > > to work > > > > out which mounts have changed. > > > > > > > > Note that there was a last minute change requested by Miklós: > > > > the > > > > event > > > > counter bits got moved from the mount notification patchset to > > > > this > > > > one. > > > > The counters got made atomic_long_t inside the kernel and __u64 > > > > in > > > > the > > > > UAPI. The aggregate changes can be assessed by comparing pre- > > > > change tag, > > > > fsinfo-core-20200724 to the requested pull tag. > > > > > > > > Karel Zak has created preliminary patches that add support to > > > > libmount[*] > > > > and Ian Kent has started working on making systemd use these > > > > and > > > > mount > > > > notifications[**]. > > > > > > So why are you asking to pull at this stage? > > > > > > Has anyone done a review of the patchset? > > > > I have been working with the patch set as it has evolved for quite > > a > > while now. > > > > I've been reading the kernel code quite a bit and forwarded > > questions > > and minor changes to David as they arose. > > > > As for a review, not specifically, but while the series implements > > a > > rather large change it's surprisingly straight forward to read. > > > > In the time I have been working with it I haven't noticed any > > problems > > except for those few minor things that I reported to David early on > > (in > > some cases accompanied by simple patches). > > > > And more recently (obviously) I've been working with the mount > > notifications changes and, from a readability POV, I find it's the > > same as the fsinfo() code. > > > > > I think it's obvious that this API needs more work. The > > > integration > > > work done by Ian is a good direction, but it's not quite the full > > > validation and review that a complex new API needs. > > > > Maybe but the system call is fundamental to making notifications > > useful > > and, as I say, after working with it for quite a while I don't fell > > there's missing features (that David hasn't added along the way) > > and > > have found it provides what's needed for what I'm doing (for mount > > notifications at least). > > Apart from the various issues related to the various mount ID's and > their sizes, my general comment is (and was always): why are we > adding > a multiplexer for retrieval of mostly unrelated binary structures? > > is 345 lines. This is not a simple and clean API. > > A simple and clean replacement API would be: > > int get_mount_attribute(int dfd, const char *path, const char > *attr_name, char *value_buf, size_t buf_size, int flags); > > No header file needed with dubiously sized binary values. > > The only argument was performance, but apart from purely synthetic > microbenchmarks that hasn't been proven to be an issue. > > And notice how similar the above interface is to getxattr(), or the > proposed readfile(). Where has the "everything is a file" > philosophy > gone? Maybe, but that philosophy (in a roundabout way) is what's resulted in some of the problems we now have. Granted it's blind application of that philosophy rather than the philosophy itself but that is what happens. I get that your comments are driven by the way that philosophy should be applied which is more of a "if it works best doing it that way then do it that way, and that's usually a file". In this case there is a logical division of various types of file system information and the underlying suggestion is maybe it's time to move away from the "everything is a file" hard and fast rule, and get rid of some of the problems that have resulted from it. The notifications is an example, yes, the delivery mechanism is a "file" but the design of the queueing mechanism makes a lot of sense for the throughput that's going to be needed as time marches on. Then there's different sub-systems each with unique information that needs to be deliverable some other way because delivering "all" the information via the notification would be just plain wrong so a multi-faceted information delivery mechanism makes the most sense to allow specific targeted retrieval of individual items of information. But that also supposes your at least open to the idea that "maybe not everything should be a file". > > I think we already lost that with the xattr API, that should have > been > done in a way that fits this philosophy. But given that we have "/" > as the only special purpose char in filenames, and even repetitions > are allowed, it's hard to think of a good way to do that. Pity. > > Still I think it would be nice to have a general purpose attribute > retrieval API instead of the multiplicity of binary ioctls, xattrs, > etc. > > Is that totally crazy? Nobody missing the beauty in recently > introduced APIs? > > Thanks, > Miklos