<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:20:55 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>Whamcloud Community JIRA</title>
    <link>https://jira.whamcloud.com</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.4.14</version>
        <build-number>940014</build-number>
        <build-date>05-12-2023</build-date>
    </build-info>


<item>
            <title>[LU-15743] &quot;lfs find&quot; is missing &quot;-xattr&quot; support</title>
                <link>https://jira.whamcloud.com/browse/LU-15743</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;It would be useful if &quot;&lt;tt&gt;lfs find&lt;/tt&gt;&quot; could check/match xattrs on files.&lt;/p&gt;

&lt;p&gt;This should use &quot;&lt;tt&gt;&amp;#45;&amp;#45;xattr &amp;lt;name&amp;gt;&lt;/tt&gt;&quot; to match files that have a &lt;tt&gt;&amp;lt;name&amp;gt;&lt;/tt&gt; xattr, and &quot;&lt;tt&gt;&amp;#45;&amp;#45;xattr-match &amp;lt;name&amp;gt;=&amp;lt;value&amp;gt;&lt;/tt&gt;&quot;, where &lt;tt&gt;&amp;lt;name&amp;gt;&lt;/tt&gt; and &lt;tt&gt;&amp;lt;value&amp;gt;&lt;/tt&gt; are shell patterns that can match arbitrary text strings in the xattr.  The output would be printed in plain text with escaped control characters.&lt;/p&gt;</description>
                <environment></environment>
        <key id="69732">LU-15743</key>
            <summary>&quot;lfs find&quot; is missing &quot;-xattr&quot; support</summary>
                <type id="4" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11310&amp;avatarType=issuetype">Improvement</type>
                                            <priority id="4" iconUrl="https://jira.whamcloud.com/images/icons/priorities/minor.svg">Minor</priority>
                        <status id="1" iconUrl="https://jira.whamcloud.com/images/icons/statuses/open.png" description="The issue is open and ready for the assignee to start work on it.">Open</status>
                    <statusCategory id="2" key="new" colorName="default"/>
                                    <resolution id="-1">Unresolved</resolution>
                                        <assignee username="bertschinger">Thomas Bertschinger</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                            <label>lad23dd</label>
                            <label>lug23dd</label>
                            <label>medium</label>
                    </labels>
                <created>Thu, 14 Apr 2022 17:55:18 +0000</created>
                <updated>Mon, 5 Feb 2024 01:01:52 +0000</updated>
                                                                                <due></due>
                            <votes>0</votes>
                                    <watches>6</watches>
                                                                            <comments>
                            <comment id="371086" author="defazio" created="Mon, 1 May 2023 20:45:59 +0000"  >&lt;p&gt;Grabbing this one for developer day.&lt;/p&gt;</comment>
                            <comment id="384271" author="adilger" created="Wed, 30 Aug 2023 19:31:55 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.whamcloud.com/secure/ViewProfile.jspa?name=defazio&quot; class=&quot;user-hover&quot; rel=&quot;defazio&quot;&gt;defazio&lt;/a&gt; did you ever make progress on this enhancement during developer day or afterward?  With the closing of &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-16798&quot; title=&quot;lfs find: new --jobid option&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-16798&quot;&gt;&lt;del&gt;LU-16798&lt;/del&gt;&lt;/a&gt;,  implementing the ability to do &quot;&lt;tt&gt;lfs find --xattr user.job=REGEXP&lt;/tt&gt;&quot; would be particularly useful.&lt;/p&gt;</comment>
                            <comment id="386468" author="defazio" created="Tue, 19 Sep 2023 22:07:52 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.whamcloud.com/secure/ViewProfile.jspa?name=adilger&quot; class=&quot;user-hover&quot; rel=&quot;adilger&quot;&gt;adilger&lt;/a&gt; Sorry, I never got around to doing this. Go ahead and assign it to someone else if you&apos;d like, I&apos;m not sure when I&apos;ll get to it.&lt;/p&gt;</comment>
                            <comment id="388910" author="JIRAUSER18444" created="Wed, 11 Oct 2023 16:33:43 +0000"  >&lt;p&gt;I&apos;ve been looking into this and can submit a patch if this isn&apos;t already being worked on.&lt;br/&gt;
One question is if this should have a printf directive?&lt;br/&gt;
Right now if I wanted to print out the jobid of some files I would have to do&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
lfs find /mnt/lustre --xattr user.job | xargs getfattr -m user.job -d &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The right way to do this with a printf directive isn&apos;t obvious to me, for example, would we want to only dump the user namespace (since e.g. &quot;lustre.lov&quot; wouldn&apos;t be helpful to dump)? Would we want to dump every user namespace xattr with newlines separating them, or in some other format? Would we want to dump only xattrs that match the supplied --xattr and --xattr-match arguments?&lt;br/&gt;
With these questions I think just using &lt;tt&gt;xargs getfattr&lt;/tt&gt; is the right way to go since then we don&apos;t have to make decisions for the user on how to print xattrs. But I wanted to ask about adding printf support in case it&apos;s important/desirable.&lt;/p&gt;</comment>
                            <comment id="388925" author="adilger" created="Wed, 11 Oct 2023 17:34:41 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.whamcloud.com/secure/ViewProfile.jspa?name=bertschinger&quot; class=&quot;user-hover&quot; rel=&quot;bertschinger&quot;&gt;bertschinger&lt;/a&gt;, it is a good question you raise, and I haven&apos;t really thought about that aspect very much.  On the one hand, it would be useful to have a &lt;tt&gt;&amp;#45;printf&lt;/tt&gt; directive to allow printing specific xattrs if they are matched (e.g. sysadmin wants to know what is in &quot;&lt;tt&gt;user.job&lt;/tt&gt;&quot; after finding files with a regexp).  However, I don&apos;t think implementing that is a &lt;b&gt;requirement&lt;/b&gt; for &quot;&lt;tt&gt;lfs find &amp;#45;&amp;#45;xattr&lt;/tt&gt;&quot; to be implemented.  As you wrote, this could be achieved with other tools after the fact, but that also adds overhead for every file accessed when &quot;&lt;tt&gt;lfs&lt;/tt&gt;&quot; may already have this information in memory after checking the file.&lt;/p&gt;

&lt;p&gt;This should be filed as a separate improvement ticket, and we can discuss there the right syntax and options for printing the xattr.  I suspect something like &quot;&lt;tt&gt;getfattr&lt;/tt&gt;&quot; can do (dump in text, hex, base64, with options for which xattrs to print) but details TBD once we have some time to think about it.  I don&apos;t think this is the most critical gap in the tool, but a nice to have.&lt;/p&gt;</comment>
                            <comment id="389118" author="JIRAUSER18444" created="Thu, 12 Oct 2023 16:21:04 +0000"  >&lt;p&gt;@Andreas thanks for the feedback. One other design / interface question...&lt;br/&gt;
The description has --xattr and --xattr-match to separately test for the presence of an xattr and to match its contents.&lt;br/&gt;
I think having two options is redundant because to test for the presence of an xattr without caring about its contents, a single &lt;tt&gt;&amp;lt;name&amp;gt;=&amp;lt;value&amp;gt;&lt;/tt&gt; option can accept&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
--xattr &lt;span class=&quot;code-quote&quot;&gt;&quot;user.job=&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;or even&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
--xattr &lt;span class=&quot;code-quote&quot;&gt;&quot;user.job&quot;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;What do you think?&lt;br/&gt;
This is problematic if you want to test for an xattr with &apos;=&apos; in its name, but that&apos;s likely an uncommon case, especially if the main use is searching JobIDs. If it&apos;s important though, it probably needs to allow escaping the &apos;=&apos;.&lt;br/&gt;
I did also consider the interface of other find implementations, but those that have xattr support seem to use --xattr to match the presence of any xattr at all (which isn&apos;t useful for Lustre since every file will match). So I don&apos;t think compatibility with other finds is worthwhile here but just wanted to bring it up for consideration.&lt;/p&gt;</comment>
                            <comment id="389264" author="adilger" created="Fri, 13 Oct 2023 16:38:30 +0000"  >&lt;p&gt;I think the following would be most useful:&lt;/p&gt;
&lt;div class=&quot;preformatted panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;preformattedContent panelContent&quot;&gt;
&lt;pre&gt;-xattr name_pattern[=value_pattern]
              File has at least one extended attribute with name that
              matches shell pattern name_pattern, and value that matches
              shell pattern value_pattern if specified.
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;While searching for &lt;tt&gt;user.job&lt;/tt&gt; xattrs will be a common use case, I suspect that there will be other cases that need to be handled, so allowing a regexp for both the name and value is useful.&lt;/p&gt;</comment>
                            <comment id="390241" author="gerrit" created="Mon, 23 Oct 2023 14:55:32 +0000"  >&lt;p&gt;&quot;Thomas Bertschinger &amp;lt;bertschinger@lanl.gov&amp;gt;&quot; uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/c/fs/lustre-release/+/52804&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/c/fs/lustre-release/+/52804&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-15743&quot; title=&quot;&amp;quot;lfs find&amp;quot; is missing &amp;quot;-xattr&amp;quot; support&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-15743&quot;&gt;LU-15743&lt;/a&gt; utils: add --xattr option to lfs find&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: ab05f6780984bf74487cb284ec85bfcf31991d60&lt;/p&gt;</comment>
                            <comment id="390325" author="adilger" created="Tue, 24 Oct 2023 07:21:56 +0000"  >&lt;p&gt;There is a prototype patch for &quot;GNU find&quot; at &lt;a href=&quot;https://gitlab.com/mweetman/findutils&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://gitlab.com/mweetman/findutils&lt;/a&gt; that adds &quot;&lt;tt&gt;&amp;#45;xattr&lt;/tt&gt;&quot; support.  According to the &lt;a href=&quot;https://gitlab.com/mweetman/findutils/-/commit/a4313fe967f7fffd3d3aabb54392ea4d902c44b2#c717da162f6446a03573da86a10d2da58fda9c94_978_995&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;find.1 man page&lt;/a&gt; in that patch, the &quot;&lt;tt&gt;&amp;#45;xattr PATTERN&lt;/tt&gt;&quot; option takes a regular expression for &lt;tt&gt;PATTERN&lt;/tt&gt; by default, but it also allows the &quot;&lt;tt&gt;&amp;#45;regextype TYPE&lt;/tt&gt;&quot; option to change the regular expression type to one of &lt;tt&gt;emacs&lt;/tt&gt;, &lt;tt&gt;posix-awk&lt;/tt&gt;, &lt;tt&gt;posix-basic&lt;/tt&gt;, &lt;tt&gt;posix-egrep&lt;/tt&gt;, and &lt;tt&gt;posix-extended&lt;/tt&gt;.  I don&apos;t think there is any urgent need for this, since &quot;&lt;tt&gt;lfs find&lt;/tt&gt;&quot; implements neither the &quot;&lt;tt&gt;&amp;#45;path&lt;/tt&gt;&quot; or &quot;&lt;tt&gt;&amp;#45;regex&lt;/tt&gt;&quot; tests.&lt;/p&gt;
</comment>
                            <comment id="390503" author="JIRAUSER18444" created="Wed, 25 Oct 2023 14:43:47 +0000"  >&lt;p&gt;Andreas, adding a question here instead of on the Gerrit review about the regex matching issue, since it&apos;s more of a user interface / design question.&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;I&apos;m not really thrilled that the regex is implicitly matching only part of the string for both the name and value, rather than explicitly requiring a wildcard for the remainder. &#160;That makes it harder to match names/values that are subsets of each other, like &quot;system.acl&quot; &quot;system.acl_default&quot; or whatever.&lt;br/&gt;
I would have assumed that it needs a regex &quot;trusted.&lt;b&gt;&quot; to explicitly match the name of all &quot;trusted.&lt;/b&gt;&quot; xattrs. &#160;Otherwise, it will be harder to match substrings in the xattr name. &#160;I see that this is how getfattr works for &quot;-m&quot;, but conversely &quot;find -regex f&quot; does not return all files with &quot;f&quot; in them (not for any regextype), only when &quot;find -regex &apos;.&lt;b&gt;f.&lt;/b&gt;&apos;&quot; or &quot;find -path &apos;&lt;b&gt;f&lt;/b&gt;&apos;&quot; is used does that happen.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;It looks like GNU find uses a non-POSIX regex interface from Gnulib, and its matching function &lt;tt&gt;re_match&lt;/tt&gt; returns the number of chars matched. So GNU find accomplishes this with basically&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (re_match(..., path, ...) == strlen(path))
...&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;It should be possible to achieve the same result with the POSIX regex interface using the pmatch[] argument to regexec, like this:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
regmatch_t pmatch[1];

regexec(re, input, 1, pmatch, 0);
&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (pmatch[0].rm_so == 0 &amp;amp;&amp;amp; pmatch[0].rm_eo == strlen(input)) {
        &lt;span class=&quot;code-comment&quot;&gt;/* matched entire input string */&lt;/span&gt;
}&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Alternatively, with the current behavior, matching the entire string could be accomplished by the user with anchors:&#160;&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;
lfs find --xattr &quot;^user.*$ /mnt/lustre&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;This could be documented/suggested in the man page to make it clear to the user if they want this behavior.&lt;/p&gt;

&lt;p&gt;A final option could be to use the Gnulib regex instead of POSIX regex for lfs find, but I&apos;m not sure if that really makes sense.&lt;/p&gt;

&lt;p&gt;What do you think is the best option?&lt;/p&gt;</comment>
                            <comment id="390572" author="adilger" created="Wed, 25 Oct 2023 18:03:52 +0000"  >&lt;p&gt;I had suggested to use &lt;tt&gt;regex_comp(..., REG_NOSUB)&lt;/tt&gt;, but I think the &lt;tt&gt;pmatch&lt;/tt&gt; option is best. I think it is non-intuitive to make the user specify &apos;&lt;tt&gt;^&lt;/tt&gt;&apos; or &apos;&lt;tt&gt;$&lt;/tt&gt;&apos; to terminate the regexp. &lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="25084">LU-5170</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="57500">LU-13031</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="75926">LU-16798</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="70232">LU-15837</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="78531">LU-17219</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="75670">LU-16760</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                                                                                                                                            <customfield id="customfield_10890" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10390" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|i02n3j:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>9223372036854775807</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>