Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1907702pxb; Fri, 25 Mar 2022 07:47:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx523XxG9qYR49PagwiBamdcUkEeyd1280RLc9KrEq4YuNk/pxRpMqUzPXNaPzsCueKjV0Z X-Received: by 2002:a17:902:a501:b0:153:f956:29f0 with SMTP id s1-20020a170902a50100b00153f95629f0mr12252977plq.120.1648219626222; Fri, 25 Mar 2022 07:47:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648219626; cv=none; d=google.com; s=arc-20160816; b=aE9TjZRhYOG1hSJ13fgaOwDyzZLHuK59CVdIi8eHCS/74aRGoh82SQ9wCPBdGI5ZR+ skHsn3IfkHsRc0n+aZlqn5DSWh7QeNQXy5kByEPaYh62ITjWfrHmidvOPLJtOskhdUBN PwpG5E1TsRjSgTtZltJe4c9S44zH8is3i1ADnExxdPbdMvoZYLiEtPd4Nqryp7Fnaxm3 a1LSUlXXrs+S2++qwHw1G4TGpQgUYACegxU6iCBMYqQL9On+dpI/0ZWw1M51job+SP4X 6vNR8jXsiKfksR8nG75Uid/iF3JnGfQv2cGYu71fZjSqmlLRAoVFVy0RST8gpclkW4iy O9Fg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=mC20+7TfRW6SdSbJR6fvSbCljYYikadz3XaqubTXWoY=; b=mtWddODAvSGAqIvOgSOnApAcJfkWyZvOSeBRisjfFymWuXbSiSfuW4nNzpjo0vhIQ8 fndWdTD14LRoRS57RAI2Au7sYby1A7wIY+aUpbmCFm8zHPsNA4vq7MfbwAJ+83uyKhhs mhKtzJrOWawLxATNbjEStEijOT8UI0H8iFmW7EScls+X3KFjsKOLViAuaR3eWUUCPAKI wLB68k2Rv8oYriponIX6o0DdJKGHCmOHOo1MQ2gl5ZtqMIW1rlQAJDLDdxaYz6sXTZmh Ka9PmrpBlZHwIBvrYRZhdSV6ctaLPnLYBB5EdJnnGN9sbg05JZ2XjO6mFWRfr5j7IkG5 4b0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.com header.s=s2048 header.b=PH0HRAXD; 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 h1-20020a636c01000000b003816043eeebsi2479508pgc.224.2022.03.25.07.46.51; Fri, 25 Mar 2022 07:47:06 -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=pass header.i=@yahoo.com header.s=s2048 header.b=PH0HRAXD; 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 S240410AbiCWWlO (ORCPT + 99 others); Wed, 23 Mar 2022 18:41:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234878AbiCWWlM (ORCPT ); Wed, 23 Mar 2022 18:41:12 -0400 Received: from sonic304-28.consmr.mail.ne1.yahoo.com (sonic304-28.consmr.mail.ne1.yahoo.com [66.163.191.154]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D407125C7B for ; Wed, 23 Mar 2022 15:39:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1648075181; bh=mC20+7TfRW6SdSbJR6fvSbCljYYikadz3XaqubTXWoY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From:Subject:Reply-To; b=PH0HRAXD67YIpmWyafy9rFOEVuYUyIq8X//OYb2DMN04faT0PnlF3KwpR8mZXy8AclhocXmwgKUmE0fKsCNQND35nq3Rf/CjFpMOI9RiVsI6NaO2C1BSauVCjct/N9mKpvjLvQ1n8N3oa9amr3PsOwn8N95yB8Bp0xb1mSMBl5RDnNlVuQ1+QVfmxH2FSKT/lt8OGQEM7IazaB/OGzj9ppAt4KAlbILYebbQjvXclM0mBb3snFQZEjJI7L/yO47jjcXT6BJ9hEQ/SUd/8rQAN7xtSmCv3dZ0Jrx9nsEtqa0eeK6bkJji0f2JEM8xOt5ecpiwr4ofvs7vzX0d7wMeew== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1648075181; bh=bT1BWLYh3huKi4ud4dqj1HI4/AEBVypxzPWNmAT4ids=; h=X-Sonic-MF:Date:Subject:To:From:From:Subject; b=ZX5EYmTz68twxKEGZE7p0+9qxsYKa8pv/0rYZljKAo0VuVCxZVHxXIIppkGgBxoh41+t7gaxd8DTZq36Ivcd6f425SQ/ZDgIvAtkCJ081k2m8bENMBgy9Tj17oKC+28OwT2sEPkyvhb7o2X4IyLxxeFzCRJHsVqU3Di3sjCfhkVjSnpuP4kf2Z/RDiJ+8AHAgbo6SGpjFfHUw/fKSZ2mDUF2LbNrPUE4PYE2J3PHAue9HC/bU6gnReLkdFuVTJTd/RstSw3ajf7vdtqVFBoz+9OJyNWEqAwqd5NLs6xs/P6UOsv6L7Kt2igZOQroFaSo48xvwbYjLihRCr5nGI4dCg== X-YMail-OSG: aRtVYpIVM1mcjJ.GzVEao9yrcefHqRuQJJQV5bnHobGLoSqFv6ixDYNnp33Q6J4 O6wcg61HZXxIrKh241.ARyjgYLW_BZomXhC_fm69liIfuCNgSw1o1DlDZDY7ckpx4EL1YHxQfvba 0XRp42brli2U0GaB2fAuhRvaIEGc1VInOFbQXm6NVyrDr6A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TrTs- X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic304.consmr.mail.ne1.yahoo.com with HTTP; Wed, 23 Mar 2022 22:39:41 +0000 Received: by hermes--canary-production-bf1-665cdb9985-6p9bt (VZM Hermes SMTP Server) with ESMTPA ID 39a8b820c79283304b7db448c9a80e45; Wed, 23 Mar 2022 22:39:39 +0000 (UTC) Message-ID: Date: Wed, 23 Mar 2022 15:39:36 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [RFC PATCH] getvalues(2) prototype Content-Language: en-US To: Miklos Szeredi Cc: Christian Brauner , 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 , Casey Schaufler References: <20220322192712.709170-1-mszeredi@redhat.com> <20220323114215.pfrxy2b6vsvqig6a@wittgenstein> From: Casey Schaufler In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Mailer: WebService/1.1.19987 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 3/23/2022 7:00 AM, Miklos Szeredi wrote: > On Wed, 23 Mar 2022 at 14:51, Casey Schaufler wrote: > >> You also need a way to get a list off what attributes are available >> and/or a way to get all available attributes. Applications and especially >> libraries shouldn't have to guess what information is relevant. If the >> attributes change depending on the filesystem and/or LSM involved, and >> they do, how can a general purpose library function know what data to >> ask for? > Oh, yes. Even the current prototype does that: > > # ~/getvalues / "" > [] = "mnt" "mntns" "xattr" "data" (len=21) > # ~/getvalues / "mnt" > [mnt] = "id" "parentid" "root" "mountpoint" "options" "shared" > "master" "propagate_from" "unbindable" (len=76) > # ~/getvalues / "mntns" > [mntns] = "21" "22" "24" "25" "23" "26" "27" "28" "29" "30" "31" "32" (len=36) > ~/getvalues / "mntns:21" > [mntns:21] = "id" "parentid" "root" "mountpoint" "options" "shared" > "master" "propagate_from" "unbindable" (len=76) That requires multiple calls and hierarchy tracking by the caller. Not to mention that in this case the caller needs to understand how mount namespaces are being used. I don't see that you've made anything cleaner. You have discarded the type checking provided by the "classic" APIs. Elsewhere in this thread the claims of improved performance have been questioned, but I can't say boo about that. Is this interface targeted for languages other than C for which the paradigm might provide (more?) value? > > I didn't implement enumeration for "data" and "xattr" but that is > certainly possible and not even difficult to do. > > Thanks, > Miklos