Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4794717iob; Mon, 9 May 2022 01:39:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxp24ig2TuT6xjpwcdDZPyAhTfwDTi1EgAjc0aOuYkYe6bV5bhkhxHPInMFsdelh7+42yBK X-Received: by 2002:a05:6e02:12b4:b0:2ca:e755:ee4a with SMTP id f20-20020a056e0212b400b002cae755ee4amr6482394ilr.65.1652085540791; Mon, 09 May 2022 01:39:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652085540; cv=none; d=google.com; s=arc-20160816; b=ki/v+fkLa3YhY+zytNeqqNLxsxXb9tJrp4dZu+h+KwrsEkLSoKIJBXgDW73OsGue/x NqEPq/I1pOV8+qj+vx3RftLZE06m5AgDLgZfMVePao88AYViNpP3+MkrEXZQHCONpkHn Rej09B1TgrfwtQ0i0PuBwrq6ULk1yOjSG/BoAhLiE8f2L+MVAQ8d7rRkdmGBX8MspFCG WuNpNeCJLX016nRJ/OL/YXf32GrIXyUq0BGmVgS5rtVuVWvoclV1BrxcdDwARkYhtWRV DyQc9ugLXn8Co+SxsDa57jm1IK9uiL9MqUTRNTbGTX0zY4K41mt7j+1h7osCCQTHBGTU JAZw== 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=0bydLn+MaadsEKy9TI70LzBq8Pin31TT5BFRic3vn7g=; b=gYM2xc9rebndYwjOl44WNWLFyovnxYBDqGxJ50VH8sBlfd4XtILl1g4AECwqsdGksi 2i09IqX7a+vkrK0Q1UR1/tOdLw8TD1Y9y8FSwHPj7RiGIlDOF6wXMZYICev0B+i1D+bZ FWYUXbedaZsoenzy2+/owxr3dUKrsuITzinBYdL4+bincEYCUd3Kab+c2UIqw8kYQ7ZW sIaBZt7T65HJkzbzuJjj4Sqe/YlAG0BIPVfA/wgD+UD27n5YAxSqB+xFaeVz8FzLXNLu LEVh6Wn3Wz10QrUG3mFXTIMQ8cywXUrTFSG9D2OfAtKjdIIZTFn4qOsMBqjX9BnXLkqM fgiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kBDdht1m; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id z11-20020a92da0b000000b002caa6b5c0c6si6652775ilm.16.2022.05.09.01.39.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 01:39:00 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=kBDdht1m; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C11781AEC73; Mon, 9 May 2022 01:22:12 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1387283AbiEFAKy (ORCPT + 99 others); Thu, 5 May 2022 20:10:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241593AbiEFAKw (ORCPT ); Thu, 5 May 2022 20:10:52 -0400 Received: from mail-qv1-xf2d.google.com (mail-qv1-xf2d.google.com [IPv6:2607:f8b0:4864:20::f2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3688A4EDED; Thu, 5 May 2022 17:07:11 -0700 (PDT) Received: by mail-qv1-xf2d.google.com with SMTP id p3so2832403qvi.7; Thu, 05 May 2022 17:07:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0bydLn+MaadsEKy9TI70LzBq8Pin31TT5BFRic3vn7g=; b=kBDdht1mILQDR5YeRdYRciPLf6mSNjR+h0e4piIWG2v8aN4VZaGlo+qap7nOYmeaGx ykor7T6KQ9snP0rfDQPcX3sgVerXCx6FC9d88f3omuuFO3fMdZcld1G8nCw/Akc3Gk66 +Qu5kDjJC6m2a14JBY4fOGHv0/fp27PK4YtfLLbObBYnvpqI8YJ16ej6DR96SbijW0HR dooiWGfHSDM94Ejq0KDN6sUCbFZ2lTi/X8tHyPUEpKdha+Q/KHe9K6CqgiaCtQi2X4OO Sz5YpmJMwt6PVDzlhGB4MI4AjRuGDD0jzgiSEmDxrsiqBlapkhAsLKWedHm/4m+kM8fk NFHQ== 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=0bydLn+MaadsEKy9TI70LzBq8Pin31TT5BFRic3vn7g=; b=IBEgNahNw/9d6uFQBP3bI8e6AKjU+F+RSve1amoDcTVE41GejnOVH+OxPdCGZ4bVB7 EkindYrBERxCMXZ4Es3gNqnMl1k4pU8nF2GQ8fylf3k1dAikUHBVnzyxdyDUgiOQg/e0 rkPSWCaUtDue8oeRFQh3807NFKoD0njz/ZJEEv0KNFI5mb2+t78kBLvzsmFnlcWetVJN /o6M9GhjHLTPCNmVX6GgWf0PWiqkaNnYORqPo9St252yseOXt0NqLR3Dsjuffa5prA6D fWvLbxuWSNVwMDVI4wnOSh29HCOkrSvMk/fEk4ZINc1cVo5DApPcC+OLXMp8vSgLNYIj Akbw== X-Gm-Message-State: AOAM531gmSWVRafE+L2n76R/mKxQalMo4g0VRnTlK2GTQxsWDRHdTOnC HI4JxJpE+9RuiT43uvJjxGL2Iloe6P1OGlXc0hs= X-Received: by 2002:a05:6214:2409:b0:432:bf34:362f with SMTP id fv9-20020a056214240900b00432bf34362fmr485516qvb.66.1651795630327; Thu, 05 May 2022 17:07:10 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Amir Goldstein Date: Fri, 6 May 2022 03:06:59 +0300 Message-ID: Subject: Re: [RFC PATCH] getting misc stats/attributes via xattr API To: tytso Cc: Miklos Szeredi , linux-fsdevel , Dave Chinner , Karel Zak , Greg KH , Christian Brauner , linux-kernel , Linux API , linux-man , LSM , Ian Kent , David Howells , Linus Torvalds , Al Viro , Christian Brauner , James Bottomley Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,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 Fri, May 6, 2022 at 2:38 AM tytso wrote: > > On Tue, May 03, 2022 at 02:23:23PM +0200, Miklos Szeredi wrote: > > > > : - root > > bar - an attribute > > foo: - a folder (can contain attributes and/or folders) > > > > The contents of a folder is represented by a null separated list of names. > > > > Examples: > > > > $ getfattr -etext -n ":" . > > # file: . > > :="mnt:\000mntns:" > > In your example, does it matter what "." is? It looks like in some > cases, it makes no difference at all, and in other cases, like this, > '.' *does* matter: It does. If "." was a directory in /proc/ or in ext4 it might have had more entries. > > > $ getfattr -etext -n ":mnt:info" . > > # file: . > > :mnt:info="21 1 254:0 / / rw,relatime - ext4 /dev/root rw\012" > > Is that right? > > > $ getfattr -etext -n ":mntns:" . > > # file: . > > :mntns:="21:\00022:\00024:\00025:\00023:\00026:\00027:\00028:\00029:\00030:\00031:" > > What is this returning? All possible mount name spaces? Or all of > the mount spaces where '.' happens to exist? This confused me too. It is not returning the mount namespaces, it is returning all the mount ids in the mount namespace of ".". ":mntns:mounts:" might have been a better choice of key. Thanks, Amir. > > Also, using the null character means that we can't really use shell > scripts calling getfattr. I understand that the problem is that in > some cases, you might want to return a pathname, and NULL is the only > character which is guaranteed not to show up in a pathname. However, > it makes parsing the returned value in a shell script exciting. > > - Ted