Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2592917iob; Fri, 6 May 2022 06:26:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMHZAyOE6RQjYMfMxD+on0o8rhytjY6YC5rSQUBeigdDGSbA4V1I0YD9s/gfk7ZNtRYfHf X-Received: by 2002:a05:6a00:1a4a:b0:4f7:be32:3184 with SMTP id h10-20020a056a001a4a00b004f7be323184mr3682541pfv.65.1651843602187; Fri, 06 May 2022 06:26:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651843602; cv=none; d=google.com; s=arc-20160816; b=HeGsIQKyOfzefdXcmFPtC8k8H56ktt1TLY5YjlB2K/EVrbNS72VYJdIPqUACzkihR9 ArN6DixBxzksiTO7nBHU947Eo58yOR/zZHRrhWbQou8n0PMbq0hZn450DZ9H1I83npSQ qRjyVEuHPzdqRfxozOSXP8NfFgdAn4BVYrBjxvsx4OpPf255kT6sUgD54JdUIzmi/d1k 1PBUPIN6hQOevSqfcgTLBQZtZj6an3rdEFdgankttUakP6FMABJVBHKGceFFb3ErmtIw kRhsWtYtFKWUMNDlrx6Y4Dh3byQxDP6WOw17c+nLuw0O2YNTZdnGhoKL5RO6703/65Za QcZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=JjAB29ugop/jQcmnKGNqrHlgLmNQnqHplcLMG6hLS1w=; b=0vVD9Hm44h7kT75SlOrm8HIkMe+ceMEmudp2CoYZsjCfL9/OJwysjA97VTsXPO+Bgb xIBfk086tUw5U2ooeuramNl+cRJjyWKNJGDDKRhOFnkX9EZWEwNOMEqegRWS5q9dMgvb F5EXE4M36WrvOk8yrs8YRRinQE9UNp2PaRKtR5Os024M9vfIHOI5rfcbvx2CSYvhenGe E+upZhHNZjMoAy4GIH7Nhlpy1QhHrt1zYSxLCAZEAaXMxFqnR0lbd6G9cWr1UCwONHCd 9FD/SUbRUM2O3u7vEJcx6UG/iX0hvrPNVslaup38WW/Xy5iOnHItG3UndqZ7vtPregA/ Js3A== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l36-20020a635b64000000b003c1829a55f6si4668394pgm.105.2022.05.06.06.26.26; Fri, 06 May 2022 06:26:42 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386824AbiEEXmZ (ORCPT + 99 others); Thu, 5 May 2022 19:42:25 -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: X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,MAY_BE_FORGED, RCVD_IN_DNSWL_MED,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 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