Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp373686pxa; Tue, 4 Aug 2020 07:40:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3zT/gA88CC9hgukdtJpI6eESOuMFgE16bomuHX1EwVwXw565xSWAX8FMRmMlx32nsMYd1 X-Received: by 2002:a50:e803:: with SMTP id e3mr19950036edn.75.1596552038425; Tue, 04 Aug 2020 07:40:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596552038; cv=none; d=google.com; s=arc-20160816; b=J/E7iQIl5c8xEPuCssIe74w0IKBQvCG8L7LNLGZBgMxncUKw2xfpDzmpudbrHOT4hn 18jLI463zT4GOMP3LvtT4ui1SzxldtbPJnNbMb7X6rE5ZZWr4Mw1lsewgCMPepkUj/i/ NzCSWmgzXA1UY79ZHG11AVT+FTPdecLzMDf7BI3iqTJTqxY+T4JBDKo8DqLSkoU+j4pc eSZ8/DC0zBGcVU8zjsTEpAMDep0UgHngynxRl3RmwjtLLqf16T5H6kvI3gihsKNdDUuD mN9H02t2Gdk0EUyt900oyph7G/OtTZu9iFn1nzrSDJBONb0qU7asBF9Q9LgFKkTDu/0W NoGw== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=GO/PaZjgiFmbIuDRQzdv2wEQ6v47brbCE/X/qo+KGSI=; b=ut3ZMRgifl9ab2FinUPvr4l/LkOJYO/qID2LArn/hjTyVfN/oHizf9s7XSKgqYGY+j 6JfrREnEA8GFxYN7boYa4BUBYEKpelJE8t2zjmR/xcQhfZDGbtqLPlz4RZWkXvS7h+sE gCfXhOqzTXaLEIuhNQt0u1szY5D85MI6EcFJZUZ4sx7055mWe+hZFVn+BcRXlhfehsLZ XsLliXiNC8Uzq7cb27f8i3pKWp4Juotd56+k9RlwzcbP1WS7e1WSYa5FcGt6mAKAYOj5 Hj0kQfrEw3szp7R6CuTAF6IpYSEi3aqqH/RGPbvGA+Ji2fNhrWEmyIqGLZZygMOTMAuj mjQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=MGzOwyvu; 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 dc26si11669855edb.203.2020.08.04.07.40.13; Tue, 04 Aug 2020 07:40:38 -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=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=MGzOwyvu; 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 S1726615AbgHDOjZ (ORCPT + 99 others); Tue, 4 Aug 2020 10:39:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727016AbgHDOhD (ORCPT ); Tue, 4 Aug 2020 10:37:03 -0400 Received: from mail-ed1-x541.google.com (mail-ed1-x541.google.com [IPv6:2a00:1450:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2B8DC06174A for ; Tue, 4 Aug 2020 07:37:02 -0700 (PDT) Received: by mail-ed1-x541.google.com with SMTP id q4so26816750edv.13 for ; Tue, 04 Aug 2020 07:37:02 -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:content-transfer-encoding; bh=GO/PaZjgiFmbIuDRQzdv2wEQ6v47brbCE/X/qo+KGSI=; b=MGzOwyvudquI7+thXiAsvTjduPmqjSU+8Jg6qbo7Hm6IpMNgUd3ikSIr6D06QgaZna 7Jf9ZKzPaRpkYpXfUnQmdC0A1myZp2zEJg9WyuiLwti06vtSHx2MffTqzYijOIG3dO+S wq+dyltnrBdKrjDuxsS6rTu9Kv1j7ITrSwn3w= 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:content-transfer-encoding; bh=GO/PaZjgiFmbIuDRQzdv2wEQ6v47brbCE/X/qo+KGSI=; b=a/NO0vlXSoUgXAYaJ9/4SFD7pUIdLRCDS251VFJxvVyv2n0gBsx0hxBoy0Pk4Pwuso 6wo8rsYXPf5iT4OoaAKkFJipFxmtjd+TGxl5iSa9fmDoRj38H6sITnIbQTg3IjY5qmNo z2CjjbalOttB/sf3QEUpeLoExAWknR1VbFi1nS2chNSIWQ8QvOIAR+zlxrPonW9M8/Q8 JXExHUJ7IR2AY2pA6srZDKILUqUkKn0o0rywBa5o5blFT/jQIrjnXNlDbI9elCc8hUoz JwU7f9oOeRyXGWpIq+uEWgC7elkdm2VpCl1r6npZQ++JdsCkMORSRPRerdSUvpivw287 7AOA== X-Gm-Message-State: AOAM532SVyH4t/tEdHwQ549AkQHuaRVk+tduvynx5v0stFu0FxrIwU4Y yT9AbIY6rjLOxp1/DAKdK1zABKpeum6DuO8+eTKowQ== X-Received: by 2002:a05:6402:12c4:: with SMTP id k4mr20551403edx.358.1596551821283; Tue, 04 Aug 2020 07:37:01 -0700 (PDT) MIME-Version: 1.0 References: <1842689.1596468469@warthog.procyon.org.uk> <1845353.1596469795@warthog.procyon.org.uk> In-Reply-To: From: Miklos Szeredi Date: Tue, 4 Aug 2020 16:36:50 +0200 Message-ID: Subject: Re: [GIT PULL] Filesystem Information To: Ian Kent 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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=C3=B3s: th= e > > > 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? 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 AP= Is? Thanks, Miklos