Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2530502ybv; Mon, 24 Feb 2020 06:56:06 -0800 (PST) X-Google-Smtp-Source: APXvYqyxfhLb1jgbd+XuTFLWK53SRLJKQT9uayVTHBHMtDWGNAvqMXOlYDOfB3HrmBxyW/l4x+nf X-Received: by 2002:a9d:5885:: with SMTP id x5mr39398509otg.132.1582556166071; Mon, 24 Feb 2020 06:56:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582556166; cv=none; d=google.com; s=arc-20160816; b=qqHwnz5w0BdVufOFIk7W3no9GUowSRW4zBCgRCK7QdBa8Wh+y68bNJ44VU/YhiK8d8 3/JeDVWQ+YdtYIBs10sJygJPLUG+3gOfF2my4ETs2lsCcuBHPS149Phos2JYONj6unkB E1O/MuPeXvkIk1HZmXWF9sXthYF80P0hBIWFpfycSCmDCCCKXIHoq81/p33+1bkm77/F aaz0/SRcoDcql4YAsyOVXS9IRpfD/f+9FfMPuldRn/Ivt2o23dN8cVgXmefhk3TuNdK7 sQb/08pXF+Nk1++UcZ1k+kkibk3LX6mr2S15EkbxVk4FsZLGYeO8//SwFOVz85ghHgfr vcCA== 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 :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature:dkim-signature; bh=L8sh8/xZNmMmN5gOnDvM1AH2hQJmwAN592RsqOlANPY=; b=evuYJIJWzkRDLAmqZlLJzvFFu+dshjMF3sFk9tHfGx4DqGSfbVhe/XjWhO2ydPE3Cf rgL5nyRDg/hyUtJ+vPG/2kUfU3ONEs3ngfLQ4lH766p3S3HwczIwMUh56dfeg1YMQYbG yuFo2NGwQx1cDLY4wGIUgp9ddWifCUFy6QCO2d7FN4sAjQf1zB7PbeLYiXVjgtJCwf+m HbB8GOG3CBQxH5ONG4fWeKcnoalRFLDrosaMOQ4qxeTeFPPWST7DrA1uDbN04Nd2bzcs 9vRu5lrpNlDqZ/Ow/sc2b3clv4kmVOrsgLPwkBuvJSMjhFJXKH/OMxtlzZi4kI/5hhkW FHhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b="Za/Ozcng"; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b="Za/Ozcng"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g25si6129727otj.198.2020.02.24.06.55.53; Mon, 24 Feb 2020 06:56:06 -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=fail header.i=@hansenpartnership.com header.s=20151216 header.b="Za/Ozcng"; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b="Za/Ozcng"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727664AbgBXOzj (ORCPT + 99 others); Mon, 24 Feb 2020 09:55:39 -0500 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:58324 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727359AbgBXOzi (ORCPT ); Mon, 24 Feb 2020 09:55:38 -0500 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id D9AAD8EE193; Mon, 24 Feb 2020 06:55:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1582556137; bh=nYoNWmZAomzGgPf7q+XQUVWK7ASnTrz9ODYpmR2mpKc=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=Za/Ozcng988/g8wymADbE9zgdkkvaF7q2cFM+uiHjmqmZVI01eMWKGeGXj5yoZqHz zW4LTM5KYvbWvLzaW9jO8C7RbNT2zgWdmQ9ZY6LelAG+ZHkW6+0wPAXJ5fIIef4uVF /0z2pvIbXhGqmOrPsG3ZJLCOQ+ILDTlH0xwnz/hE= Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wH3sn0ON16yB; Mon, 24 Feb 2020 06:55:37 -0800 (PST) Received: from jarvis.ext.hansenpartnership.com (jarvis.ext.hansenpartnership.com [153.66.160.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 1B36F8EE0E2; Mon, 24 Feb 2020 06:55:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1582556137; bh=nYoNWmZAomzGgPf7q+XQUVWK7ASnTrz9ODYpmR2mpKc=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=Za/Ozcng988/g8wymADbE9zgdkkvaF7q2cFM+uiHjmqmZVI01eMWKGeGXj5yoZqHz zW4LTM5KYvbWvLzaW9jO8C7RbNT2zgWdmQ9ZY6LelAG+ZHkW6+0wPAXJ5fIIef4uVF /0z2pvIbXhGqmOrPsG3ZJLCOQ+ILDTlH0xwnz/hE= Message-ID: <1582556135.3384.4.camel@HansenPartnership.com> Subject: Re: [PATCH 00/17] VFS: Filesystem information and notifications [ver #17] From: James Bottomley To: Miklos Szeredi Cc: David Howells , viro , Ian Kent , christian@brauner.io, Jann Horn , darrick.wong@oracle.com, Linux API , linux-fsdevel , lkml Date: Mon, 24 Feb 2020 06:55:35 -0800 In-Reply-To: References: <158230810644.2185128.16726948836367716086.stgit@warthog.procyon.org.uk> <1582316494.3376.45.camel@HansenPartnership.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 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 Mon, 2020-02-24 at 11:24 +0100, Miklos Szeredi wrote: > On Fri, Feb 21, 2020 at 9:21 PM James Bottomley > wrote: [...] > > 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. > > And that makes me wonder: would a > "/sys/class/fs/$ST_DEV/options/$OPTION" type interface be feasible > for this? Once it's table driven, certainly a sysfs directory becomes possible. The problem with ST_DEV is filesystems like btrfs and xfs that may have multiple devices. The current fsinfo takes a fspick'd directory fd so the input to the query is a path, which gets messy in sysfs, although I could see something like /sys/class/fs/mount//$OPTION working. James