Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1153886pxb; Thu, 24 Mar 2022 13:55:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCC1vGQXxEPB6PVgok8LsPFWtwBBlwilS7D6FQh5NFg7W4xkWL4mjbGyT4LvWOTHX6USiT X-Received: by 2002:a05:6a00:2392:b0:4fa:dcd2:5bc1 with SMTP id f18-20020a056a00239200b004fadcd25bc1mr6868192pfc.8.1648155315636; Thu, 24 Mar 2022 13:55:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648155315; cv=none; d=google.com; s=arc-20160816; b=0ZF8NrAI4GsPAv5B3c096GQYIzO9KXJkohnlyGfOObjCltfeYL9S5HRgmrGSHxtCPL Jw2p4iGhizBQAJd5oO07M0/hzW1GZZWp1hobBvKuc420HXrLD9li+2664NPbtUEFDXj3 RoLO55f8gINqMO+M4x2ps0rax5QWGQNtOHYmBjUrNSibSvEBndvcZBUw1ZNAAmLU+9zh sxwIJ4Ux9gMEYgsrpA1HU/DwqnPEL9VGwS1YovKZQOW0RCf6bzGEyrCulcGHoojE7QWY uY8e7khqkxzvesG9bNiFjzlIDWh2Yi4mBCpbQQW3w1FMEJqEhRkHOCqVdXsERUHY/TvK cIfQ== 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=4d3TC6ucZyuq0GaJLfYb56R+2q2cWcG09rOvKNcww+Y=; b=XZsq7BOSZpR0MAHc6nEItWfDFfiZzQeQJXP2ieqgurgminSp5UORRYtH7eWKMXjG0z Bq7jbE1q7ar14aghSblM7MkvO41ffO7/xE+ltpIyCGGyNVYN5iXxocbrtNgBYmApk+Q+ HsWM2GgL1F2k4eVkljwDIx/ZkltOPCM9Az+X3eUFkAMIp5k/ewdMQQfQifytYY9i6WYk krnPL+3cpUpku7U9uM6w8h72YP9iy7HtiJcS/TOJRtkmfq2uDK3F/nwpInuZdUuKGVpS 3Fxo7SrROmblMx9xXIhFWT1zIIQ0AXW8Y4L3oqveKunvYDki6Dn5Sdjc9KdEOUTHhOC2 U7Nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@szeredi.hu header.s=google header.b=rFUzZvUj; 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 f6-20020a056a00228600b004faaaf18941si995510pfe.8.2022.03.24.13.55.02; Thu, 24 Mar 2022 13:55:15 -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=rFUzZvUj; 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 S244570AbiCWOBt (ORCPT + 99 others); Wed, 23 Mar 2022 10:01:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244580AbiCWOBq (ORCPT ); Wed, 23 Mar 2022 10:01:46 -0400 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C4AC7EA12 for ; Wed, 23 Mar 2022 07:00:15 -0700 (PDT) Received: by mail-ed1-x52e.google.com with SMTP id r23so1990949edb.0 for ; Wed, 23 Mar 2022 07:00:15 -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=4d3TC6ucZyuq0GaJLfYb56R+2q2cWcG09rOvKNcww+Y=; b=rFUzZvUj9PsjZGaz0GrV+BnYRedhsb5f6r1ptV1gfdWwY3xslFCdzrM4x24fCLycBF 9MmlSkTxmB5ZKWfAkT//oYix5YBcg1GZ4A2hycMnzXs6IYSldeqDJ8lhln4BxNICUIAj mGDJBuAQAWmHOfAHbGGJKcoRyTOtF9/dlWLZ8= 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=4d3TC6ucZyuq0GaJLfYb56R+2q2cWcG09rOvKNcww+Y=; b=upk2T4J/QxUkxQiBAHUAoyIO6mbzeFVMM37595EVG+SLaP0k3ZaGSvqaiOiwHNnQhi Rs3C9eTijd5OiJL56r7E4KDKhktGs+qVhlfvwnuBNjUZeoDwe1cCHQlW1xZ3OTZAFxYm Kodg1yTphp/QdeqMC0peLyW4HeQWmzsbbbzTBqKn/CMTZGoCJ+dlLRLGb4r9KooKOvTH 9ak3yxEwChM2RfLHwL5ZK9REHVLO6h5Yp60QdOtxuGb4KogLbEW3zyvZ3Bag/c/Uz11h hT8DmomSQx8G09OLY3FxmKlLFWebPq7DcUKpPRQ6lpxsgOe9elct8iUStgMvUdhBQ+7b /CUg== X-Gm-Message-State: AOAM532C2XWXQXJ4eBY+ZanVefk+kE820xNKKsKRxS9kWbClGeDwQugW lLx976SevWBRxYjFKcxzlxibmNpf4ivUmEhWPjh9Bg== X-Received: by 2002:a05:6402:5106:b0:419:45cd:7ab0 with SMTP id m6-20020a056402510600b0041945cd7ab0mr235899edd.116.1648044014041; Wed, 23 Mar 2022 07:00:14 -0700 (PDT) MIME-Version: 1.0 References: <20220322192712.709170-1-mszeredi@redhat.com> <20220323114215.pfrxy2b6vsvqig6a@wittgenstein> In-Reply-To: From: Miklos Szeredi Date: Wed, 23 Mar 2022 15:00:01 +0100 Message-ID: Subject: Re: [RFC PATCH] getvalues(2) prototype To: Casey Schaufler 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 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 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) I didn't implement enumeration for "data" and "xattr" but that is certainly possible and not even difficult to do. Thanks, Miklos