Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp682604ybf; Wed, 26 Feb 2020 21:07:05 -0800 (PST) X-Google-Smtp-Source: APXvYqy7LnyiLIu0zPCbbbnK7DI/52PHgszBQ7BDVI+bBRG9Kp4FH/+82f2tP2wnRCVwZz5PmRbT X-Received: by 2002:a9d:6b91:: with SMTP id b17mr1793701otq.235.1582780025793; Wed, 26 Feb 2020 21:07:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582780025; cv=none; d=google.com; s=arc-20160816; b=b0gWz+zGk01YbPd7z2dfTMj6gA70TxkiljNK+JiYL1PNUauJicL5+4yIUKcXUTTH/M QiEfG3a/39v4jfOnCPv/L6SSvUQ+8XfnhqcNL0BitEHbjtQTcbdrfYsQJD8qx0nBdH5B rFRFFt2wgUuZGZmNbh0xcSSgEHA3WpOJq8vx+DalFozpCL0lOa07UJkXJRsy3lomrqqq qS1CfJTm2iYf8/0brs31BwoezKMVgG5o8hMXVAXy3STozPTL96V3Lmf/T2t/bOC528V0 PA26kIhXj6nElU9PCR6wnPvPi/bm0mDTmBST5i7kUWtrhBhw9q1v7+KmC7bEjnKvD4rK yDSw== 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=7VMetkVh205MzER1jhY7QfzeT/S8gk9URVRPcaR9UKY=; b=hbHRRYAlIaR7uk8tUibMRXV5vd0bRsRsiye6G9TasqSrp5PPyIVDZDwC1Lc+bBP6cm /W9SOTprHL1ztZYAkJvI5kgW5tUJhKuu5GQ1tKun/1fPmPm6aUOy2hN2FlWojDF+cBEW eylud1gJqZp8MXhr6UVx3GBF7hJAHS+crl0IICAdEWwdbxMWgQxAj6FSutXcZJ2WPPu3 3pm6+clTXP2O+5xZ0wgpAo3HsgUzcA/MtEuTM+iT5ln8KxZxN/FitWNAiDmNlXeVfYq/ Qa5Y7p5Bizkt9aT7i7NOGAkCjwzGBypHJBAYWoAs84jBCDDp4xwNsrTLYXUHNhJZr4i7 AaTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@themaw.net header.s=fm2 header.b=W2OsanbM; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=s2D+WB69; 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 c189si736286oig.74.2020.02.26.21.06.53; Wed, 26 Feb 2020 21:07:05 -0800 (PST) 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=pass header.i=@themaw.net header.s=fm2 header.b=W2OsanbM; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=s2D+WB69; 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 S1725870AbgB0FGu (ORCPT + 99 others); Thu, 27 Feb 2020 00:06:50 -0500 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:59977 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725790AbgB0FGu (ORCPT ); Thu, 27 Feb 2020 00:06:50 -0500 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id 27D5C737F; Thu, 27 Feb 2020 00:06:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 27 Feb 2020 00:06:47 -0500 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=fm2; bh= 7VMetkVh205MzER1jhY7QfzeT/S8gk9URVRPcaR9UKY=; b=W2OsanbM4Y8N7In5 ulcg2cGkc762HChDxbpL7sdlY3FHEr5UtUaky3Id8B4Ez8PVwLkaF8cfEpICIdBy Xt7n/6Dqk5eI0e9+rMeUws2jM5RFovMCugq/+PvYK5jEXpfQan0q58LWdchZ2bfR WzeY10G1WL4d7N8leKIlgQqyysYWhjhW/BMmasr3oPfa1GOSd5ABB7A3H75gtt/x bXclqh60MTUvIcM/qtScr0uW+euP6nWv4EyQkbvJLNdwZPabxC9Z/wBRlTlTwBmH bfEeQEx3KWLaawlf5FdpkiqtUASSGU5lRdXJ5ZUK8KNvHa6k+A/chvB/Olwq2lLZ Bd1cUA== 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=fm2; bh=7VMetkVh205MzER1jhY7QfzeT/S8gk9URVRPcaR9U KY=; b=s2D+WB69gZXt5NsTV7nJlj/+NG6CxkQ5cJWonajElYzKmdNc2fxAODUR5 vLjjyzrHRBo1uSgVb7VPVOPbQ4BJkBglTx+kkoUUfPvcKcF7bY+UghGP/dlZWL44 WJULFq6b2tHrB2rXxOi08xPrUyu2VxELzKsrZ93L8UfXLlmNFHOpIfiXNDoR7uQW W9BWiBePb2kB6zeA1mtU+YZHeLXHnrCaQo3dIMoH0TgZCKDn7VIv3zP8QqxXQdtA fvdC7SGbyGvO3E9j1HucB7UXo/KbPiLMU4Adiswzw7DTEln6Q8Mzvu8Ey54uHEDS vPQXTN7R6HV1lKXYR7oTMRYpWHV/Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrleehgdekvdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkuffhvfffjghftggfggfgsehtjeertddtreejnecuhfhrohhmpefkrghnucfm vghnthcuoehrrghvvghnsehthhgvmhgrfidrnhgvtheqnecukfhppeduudekrddvtdekrd dukeehrddugeeknecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomheprhgrvhgvnhesthhhvghmrgifrdhnvght X-ME-Proxy: Received: from mickey.themaw.net (unknown [118.208.185.148]) by mail.messagingengine.com (Postfix) with ESMTPA id CE3CA3280059; Thu, 27 Feb 2020 00:06:41 -0500 (EST) Message-ID: <1c8db4e2b707f958316941d8edd2073ee7e7b22c.camel@themaw.net> Subject: Re: [PATCH 00/17] VFS: Filesystem information and notifications [ver #17] From: Ian Kent To: Miklos Szeredi , James Bottomley Cc: Steven Whitehouse , Miklos Szeredi , David Howells , viro , Christian Brauner , Jann Horn , "Darrick J. Wong" , Linux API , linux-fsdevel , lkml Date: Thu, 27 Feb 2020 13:06:37 +0800 In-Reply-To: References: <158230810644.2185128.16726948836367716086.stgit@warthog.procyon.org.uk> <1582316494.3376.45.camel@HansenPartnership.com> <1582556135.3384.4.camel@HansenPartnership.com> <1582644535.3361.8.camel@HansenPartnership.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-02-26 at 10:11 +0100, Miklos Szeredi wrote: > On Tue, Feb 25, 2020 at 4:29 PM James Bottomley > wrote: > > > The other thing a file descriptor does that sysfs doesn't is that > > it > > solves the information leak: if I'm in a mount namespace that has > > no > > access to certain mounts, I can't fspick them and thus I can't see > > the > > information. By default, with sysfs I can. > > That's true, but procfs/sysfs has to deal with various namespacing > issues anyway. If this is just about hiding a number of entries, > then > I don't think that's going to be a big deal. I didn't see name space considerations in sysfs when I was looking at it recently. Obeying name space requirements is likely a lot of work in sysfs. > > The syscall API is efficient: single syscall per query instead of > several, no parsing necessary. > > However, it is difficult to extend, because the ABI must be updated, > possibly libc and util-linux also, so that scripts can also consume > the new parameter. With the sysfs approach only the kernel needs to > be updated, and possibly only the filesystem code, not even the VFS. > > So I think the question comes down to: do we need a highly efficient > way to query the superblock parameters all at once, or not? Or a similar question could be, how could a sysfs interface work to provide mount information. Getting information about all mounts might not be too bad but the sysfs directory structure that would be needed to represent all system mounts (without considering name spaces) would likely result in somewhat busy user space code. For example, given a path, and the path is all I know, how do I get mount information? Ignoring possible multiple mounts on a mount point, call fsinfo() with the path and get the id (the path walk is low overhead) to use with fsinfo() to get the all the info I need ... done. Again, ignoring possible multiple mounts on a mount point, and assuming there is a sysfs tree enumerating all the system mounts. I could open + mount point path followed buy opening and reading the individual attribute files ... a bit more busy that one ... particularly if I need to do it for several thousand mounts. Then there's the code that would need to be added to maintain the various views in the sysfs tree, which can't be restricted only to the VFS because there's file system specific info needed too (the maintain a table idea), and that's before considering name space handling changes to sysfs. At the least the question of "do we need a highly efficient way to query the superblock parameters all at once" needs to be extended to include mount table enumeration as well as getting the info. But this is just me thinking about mount table handling and the quite significant problem we now have with user space scanning the proc mount tables to get this information. Ian