Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp571508pxa; Tue, 4 Aug 2020 12:19:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQUbTLE8P4wzT7ldOYZw/yQA85Mr2qYGwT764SSMEIyNCFr0d2i5yDjN/4DUayfSLSEKjp X-Received: by 2002:a17:906:8506:: with SMTP id i6mr22869800ejx.446.1596568774216; Tue, 04 Aug 2020 12:19:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596568774; cv=none; d=google.com; s=arc-20160816; b=qVBlbrwIsG26NkmqlijiRU8jIMOG1fEpAOEpFXL8KTiBLLrlxF32TTKR0CKwnMCNKI 0gkdmQnBuXAuRQ9t++Oz0mxUuFQtpmOS5SKdfe0z7c4q5xQYfVlh83BuR0d/DiX2psGZ pPU1UvOVcHVbwCVWoI4LPwdQM/0w3cvSqd/eSb8vijSVgmccqE5qZEeicOOabQTMw79w zts726TFxj5ztrLDGJklQgF8Q2kqlNoCaCkWRcSfbpoBQ7na3OarYfiodcIXP4e6Cjqu Wdf14b4LmeJ+587Pw4zJ8ZmQS3U76bbzRM/HjSBGiranlska/yGWBfJ1GdMihtfpaaVw 7gug== 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=iECZKbCttisI32R5vOBuQe0LHnglBF7s4axnvjSdNlk=; b=UatxsqGCbl6SIJrmAAp9+7B9fHjKceajhs1wFCUHdoYJdjhvg5V21o1DVndam5nH+E lasHJGytPVweRQua+l5x/vLx0utxa2qNFPnyg4N2TRG9IiYxHICU2gQq4usJz6VYZLKI g5sQ+RlLj7oylWpwrzN1Iy4YIpHsVN8ITHdirniJvpsbckP14jxTTiYC6d1V0GqwxtZB rbwqnQz6uRJ8bJdOd1FQrel/n3pJm0Xznh/3vJE0MK2p3A7Dzx1vM0dS3jtVOUnw5+Pg 2OJuc19toizjjxkUihN4GK/ROymsh0HWGVCWbNNixRW6FwJM4vjgnb6RfvKcccPaZBG1 o2yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b="nQ4grv0/"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-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 um11si12665624ejb.117.2020.08.04.12.18.57; Tue, 04 Aug 2020 12:19:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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="nQ4grv0/"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726824AbgHDTSw (ORCPT + 99 others); Tue, 4 Aug 2020 15:18:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45376 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726027AbgHDTSv (ORCPT ); Tue, 4 Aug 2020 15:18:51 -0400 Received: from mail-ej1-x642.google.com (mail-ej1-x642.google.com [IPv6:2a00:1450:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67A21C061756 for ; Tue, 4 Aug 2020 12:18:51 -0700 (PDT) Received: by mail-ej1-x642.google.com with SMTP id bo3so21065932ejb.11 for ; Tue, 04 Aug 2020 12:18:51 -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=iECZKbCttisI32R5vOBuQe0LHnglBF7s4axnvjSdNlk=; b=nQ4grv0/FGhjcX/X9Q+kj/w809eT436vH2U+X4EgTlnaRGNA7g8vikX3m+zfSmYRaT i6cmBUlwtVL6LQdpbpBz3ozbnlKtLwkowabhGu0920duv5F6NKDItb0IoNMhvkRdBd2i gIIVodOYdnVzl0Ma8TCtUfhW97EQEZHXDBBfE= 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=iECZKbCttisI32R5vOBuQe0LHnglBF7s4axnvjSdNlk=; b=nKLJjAyFSjR21VDF1jC+10/2dY1bcW8rVeirXP8I8vfv6KUuTcS8efAuCNtinAIpiY rHDy6GHgYcJvd1VNK/LSiDtS/Epmss9Mc0dJltOffmanS4MfTiVlkuWOKB1hO5qL8Qz1 DKxd4Q79CIGRXuaq/N+frN3WHNPUs4WYYvoUMWvYPV36xdqiaGTJBzlkg+IWPq2w5mty nceDjNyHShb1R8RKUNpaAcdaouRtAzNINt4I96xd5aCoP8TgMHJimJVdbkyTkd10yOEF NKHJFjboq15+y1KF4+uooZLay6Amc6htppwaFflg2Gz1yOk1R+8PgHpZEtf0pPuxMyWn zE5Q== X-Gm-Message-State: AOAM533tqoqWm0beKhgn9cbn2xZUGKYj1SVj4fG9bJnN4t7LlKZQM++0 /MVF4Kakb5DPz3k1RvVCEFLBRjTWILGnPg6XS4wXfw== X-Received: by 2002:a17:906:4aca:: with SMTP id u10mr20883333ejt.320.1596568729975; Tue, 04 Aug 2020 12:18:49 -0700 (PDT) MIME-Version: 1.0 References: <159646178122.1784947.11705396571718464082.stgit@warthog.procyon.org.uk> <1596555579.10158.23.camel@HansenPartnership.com> In-Reply-To: <1596555579.10158.23.camel@HansenPartnership.com> From: Miklos Szeredi Date: Tue, 4 Aug 2020 21:18:38 +0200 Message-ID: Subject: Re: [PATCH 00/18] VFS: Filesystem information [ver #21] To: James Bottomley Cc: David Howells , Al Viro , "Theodore Ts'o" , Andreas Dilger , Eric Biggers , Jeff Layton , linux-ext4@vger.kernel.org, Carlos Maiolino , "Darrick J. Wong" , Linux API , Linus Torvalds , Ian Kent , Miklos Szeredi , Christian Brauner , Jann Horn , Karel Zak , Jeff Layton , linux-fsdevel@vger.kernel.org, LSM , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue, Aug 4, 2020 at 5:40 PM James Bottomley wrote: > > On Mon, 2020-08-03 at 14:36 +0100, David Howells wrote: > > 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 notifications patchset and allows > > event counters implemented in the latter to be retrieved to allow > > overruns to be efficiently managed. > > Could I repeat the question I asked about six months back that never > got answered: > > https://lore.kernel.org/linux-api/1582316494.3376.45.camel@HansenPartnership.com/ > > It sort of petered out into a long winding thread about why not use > sysfs instead, which really doesn't look like a good idea to me. > > I'll repeat the information for those who want to quote it easily on > reply without having to use a web interface: > > --- > Could I make a suggestion about how this should be done in a way that > doesn't actually require the fsinfo syscall at all: it could just be > done with fsconfig. The idea is based on something I've wanted to do > for configfd but couldn't because otherwise it wouldn't substitute for > fsconfig, but Christian made me think it was actually essential to the > ability of the seccomp and other verifier tools in the critique of > configfd and I belive the same critique applies here. > > Instead of making fsconfig functionally configure ... as in you pass > the attribute name, type and parameters down into the fs specific > handler and the handler does a string match and then verifies the > parameters and then acts on them, make it table configured, so what > each fstype does is register a table of attributes which can be got and > optionally set (with each attribute having a get and optional set > function). We'd have multiple tables per fstype, so the generic VFS > can register a table of attributes it understands for every fstype > (things like name, uuid and the like) and then each fs type would > register a table of fs specific attributes following the same pattern. > The system would examine the fs specific table before the generic one, > allowing overrides. fsconfig would have the ability to both get and > set attributes, permitting retrieval as well as setting (which is how I > get rid of the fsinfo syscall), we'd have a global parameter, which > would retrieve the entire table by name and type so the whole thing is > introspectable because the upper layer knows a-priori all the > attributes which can be set for a given fs type and what type they are > (so we can make more of the parsing generic). Any attribute which > doesn't have a set routine would be read only and all attributes would > have to have a get routine meaning everything is queryable. fsconfig(2) takes an fd referring to an fs_context, that in turn refers to a super_block. So using fsconfig() for retrieving super_block attributes would be fine (modulo value being const, and lack of buffer size). But what about mount attributes? I don't buy the argument that an API needs to be designed around the requirements of seccomp and the like. It should be the other way round. In that, I think your configfd idea was fine, and would answer the above question. Thanks, Miklos