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 80B76C4332F for ; Thu, 5 May 2022 23:38:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386823AbiEEXmX (ORCPT ); Thu, 5 May 2022 19:42:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233701AbiEEXmW (ORCPT ); Thu, 5 May 2022 19:42:22 -0400 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 522DD2559B; Thu, 5 May 2022 16:38:41 -0700 (PDT) Received: from penguin.thunk.org (corpnat-104-133-9-85.corp.google.com [104.133.9.85] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 245NcDT2021685 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 5 May 2022 19:38:14 -0400 Received: by penguin.thunk.org (Postfix, from userid 1000) id 4B9634B485; Thu, 5 May 2022 16:38:12 -0700 (PDT) Date: Thu, 5 May 2022 16:38:12 -0700 From: tytso To: Miklos Szeredi Cc: linux-fsdevel@vger.kernel.org, Dave Chinner , Karel Zak , Greg KH , Christian Brauner , linux-kernel@vger.kernel.org, Linux API , linux-man , LSM , Ian Kent , David Howells , Linus Torvalds , Al Viro , Christian Brauner , Amir Goldstein , James Bottomley Subject: Re: [RFC PATCH] getting misc stats/attributes via xattr API Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org 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: > $ 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? 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