From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 36BECC433F5 for ; Wed, 23 Mar 2022 14:00:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244575AbiCWOBw (ORCPT ); Wed, 23 Mar 2022 10:01:52 -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-Google-Smtp-Source: ABdhPJydsCbI4K1DE26qhLWLhXVBLuexIeZknzjGHVibPwTP54CzEhxreoeycnCPeXjsI3G4qYdNmj5hUJK4kLkYjKo= 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" 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