Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1834325pxb; Fri, 25 Mar 2022 06:31:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyP+hJUUoqoPVqzshYw7iwM5UzSjfKslEQqzeVaKTu0ThaM6tAnDaCAoJOnk5f/fvEOTn5b X-Received: by 2002:a63:4e26:0:b0:386:1839:3bde with SMTP id c38-20020a634e26000000b0038618393bdemr8122139pgb.603.1648215082729; Fri, 25 Mar 2022 06:31:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648215082; cv=none; d=google.com; s=arc-20160816; b=jofWlkoWDvzFFAcPeA+4/1nO1HSLTJIDvF6XGYBfNOGjgxINkmI20m9h7DipyC1ze1 04/SShpdxUbXOmLwYu0A9QQZZcClXzeXJHjxG9fealSfCu2VAAhGBR4QOI3Amq4F3fVH dzTQPXVbiK8BjrZKjq9/H8iBY4B/ZsQXJSJZ5F4HigDkEPX6u9QrekFklJ+UMYph/VgV 8qTj69aQk3tOG/wBb3jFE74unREcLoaa8ctmqz9J0kP4KpSGTlf0bk9lZ4Pi20YmvDUX jimXvsD20uCAyC4IfyhKbcjiU/htJr0KN/h67aQmEbe7phI39Lm4zcKBQX0ARiwTRCw/ D0nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=TZ6s65rDvN8Tqn0qDZEB8Ijp4jvPh0GyNpSk/ZtB3pI=; b=nB2P8AxlBTTnxockgrWEZMOt+HbZGLhSWwuDiyFyGVCpecaGJAYjGjRxVGDxY+N37p gmSYVCflW2i+UZrqHQ1wFhFd+VF8CDiid7sNt/qYubyFyeIbjOFx2caPMfo4AzFPxGlE zXo6zDijORPCdd85/tNVhekothDnoVoeNpTojQkNCcLXy4hNsixhwNmrpiUObSFj1GS7 55lBCLutYkEuBexOIsihDpOIl5z0z3rx3gVS9vgZHuWP/cfUee6GMflMJDZWjPThGCBO TuQxHSd9OJX8Oo/yjU4Q5R/dsqRoxawx0wly1ZBRCIdJFR8HMXacA+NDbJntUTWi8rKJ hmXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=m8uvN3vl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n64-20020a632743000000b003816043ef93si2397624pgn.392.2022.03.25.06.31.07; Fri, 25 Mar 2022 06:31:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=m8uvN3vl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349081AbiCXI7P (ORCPT + 99 others); Thu, 24 Mar 2022 04:59:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243847AbiCXI7K (ORCPT ); Thu, 24 Mar 2022 04:59:10 -0400 Received: from mail-ej1-x633.google.com (mail-ej1-x633.google.com [IPv6:2a00:1450:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB2549D0C3 for ; Thu, 24 Mar 2022 01:57:38 -0700 (PDT) Received: by mail-ej1-x633.google.com with SMTP id j15so7714273eje.9 for ; Thu, 24 Mar 2022 01:57:38 -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=TZ6s65rDvN8Tqn0qDZEB8Ijp4jvPh0GyNpSk/ZtB3pI=; b=m8uvN3vl8Uzj9zAwWsZQwJeD4SgdTCd74DSTmwxQoZYwKcDUMIa06VjnueJ49ViSg6 AH6m1oASGMxV+L7gbdqnZl0DsC1kLdBlx0tkhj9scA0ROyULs+xnhqKjG+EjiECTe9v9 fHLplZ4INS5E2/hQbGf40wOuvgjoBCnl4uueQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TZ6s65rDvN8Tqn0qDZEB8Ijp4jvPh0GyNpSk/ZtB3pI=; b=0FrH4c4qd8Y2MW7z/dfgNh0ubO8d22jsqoC0L7hTZ3Q3Zhkjd3TE/NKvd0bbjv4Wup 4LLUG+BLh1AwGJABDQOLxb3uw8gHcv5jYcwq1J6YGLCvRdPbKlZv8fbJjmst3izU6+Qx aML5/BK36gjmbUJ6Aju4aLNBXy5UISF361jcyIKXpajTINEQ9Bks5brCNpfZihzw+5yo jYNassPpWurm39NAYGs1gkh4uoSk0C38Lw6bm2xFaVAVXaIh1r1xEcaRPyMHqzkR8uCV dekDuYb228cOLkYLkz4KdqelG/mF0wBBrjTsaMuXMPkvU4bTQlt4xLLkVDY23sV9MPoa P72w== X-Gm-Message-State: AOAM53328fCjH0NBqFQXKSy6y0O0IyqFQa+eZH+d1rL9YiuuamM7zrfa SIRVRZWNU+y50GoS2HjX4XCBQ8zaKVi77zVdsLIxUg== X-Received: by 2002:a17:907:c16:b0:6db:1dfc:ca73 with SMTP id ga22-20020a1709070c1600b006db1dfcca73mr4602838ejc.192.1648112257373; Thu, 24 Mar 2022 01:57:37 -0700 (PDT) MIME-Version: 1.0 References: <20220322192712.709170-1-mszeredi@redhat.com> <20220323225843.GI1609613@dread.disaster.area> In-Reply-To: <20220323225843.GI1609613@dread.disaster.area> From: Miklos Szeredi Date: Thu, 24 Mar 2022 09:57:26 +0100 Message-ID: Subject: Re: [RFC PATCH] getvalues(2) prototype To: Dave Chinner Cc: Miklos Szeredi , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Linux API , linux-man , LSM , Karel Zak , Ian Kent , David Howells , Linus Torvalds , Al Viro , Christian Brauner , Amir Goldstein , James Bottomley Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 23 Mar 2022 at 23:58, Dave Chinner wrote: > > On Tue, Mar 22, 2022 at 08:27:12PM +0100, Miklos Szeredi wrote: > > - Interfaces for getting various attributes and statistics are fragmented. > > For files we have basic stat, statx, extended attributes, file attributes > > (for which there are two overlapping ioctl interfaces). For mounts and > > superblocks we have stat*fs as well as /proc/$PID/{mountinfo,mountstats}. > > The latter also has the problem on not allowing queries on a specific > > mount. > > https://xkcd.com/927/ Haha! > I've said in the past when discussing things like statx() that maybe > everything should be addressable via the xattr namespace and > set/queried via xattr names regardless of how the filesystem stores > the data. The VFS/filesystem simply translates the name to the > storage location of the information. It might be held in xattrs, but > it could just be a flag bit in an inode field. Right, that would definitely make sense for inode attributes. What about other objects' attributes, statistics? Remember this started out as a way to replace /proc/self/mountinfo with something that can query individual mount. > > mnt - list of mount parameters > > mnt:mountpoint - the mountpoint of the mount of $ORIGIN > > mntns - list of mount ID's reachable from the current root > > mntns:21:parentid - parent ID of the mount with ID of 21 > > xattr:security.selinux - the security.selinux extended attribute > > data:foo/bar - the data contained in file $ORIGIN/foo/bar > > How are these different from just declaring new xattr namespaces for > these things. e.g. open any file and list the xattrs in the > xattr:mount.mnt namespace to get the list of mount parameters for > that mount. Okay. > Why do we need a new "xattr in everything but name" interface when > we could just extend the one we've already got and formalise a new, > cleaner version of xattr batch APIs that have been around for 20-odd > years already? Seems to make sense. But...will listxattr list everyting recursively? I guess that won't work, better just list traditional xattrs, otherwise we'll likely get regressions, and anyway the point of a hierarchical namespace is to be able to list nodes on each level. We can use getxattr() for this purpose, just like getvalues() does in the above example. Thanks, Miklos