<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:54:09 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-5746] llapi: fid2path doesn&apos;t return all the names associated with a fid</title>
                <link>https://jira.whamcloud.com/browse/LU-5746</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;llapi_fid2path can (or should) enumerate all the files associated with a fid, by using the linkno parameter. This is supported by lfs.&lt;/p&gt;

&lt;p&gt;However when the number of hard link is big, this is no longer true. For instance, create a file, and many hardlinks to it:&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;cd /mnt/lustre/test/
touch foo
count=1; while [[ $count -le 180 ]]; do ln foo alinktofoo$count; (( count++ )) ; done
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Get the fid of the file&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;# ~/lustre-cleanup/lustre/utils/lfs path2fid ./foo
[0x200000400:0x8b8:0x0]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;and then call fid2path on it:&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;# ~/lustre-cleanup/lustre/utils/lfs fid2path /mnt/lustre/ 0x200000400:0x8b8:0x0
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The output will be something like&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;/mnt/lustre/test/foo
/mnt/lustre/test/alinktofoo1
/mnt/lustre/test/alinktofoo2
/mnt/lustre/test/alinktofoo3
/mnt/lustre/test/alinktofoo4
.......
/mnt/lustre/test/alinktofoo130
/mnt/lustre/test/alinktofoo131
/mnt/lustre/test/alinktofoo132
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Only the first 133 entries are returned, leaving out 47.&lt;/p&gt;

&lt;p&gt;The interesting thing is that if the names of the links are longer (replace alinktofoo$count with averylinktofoo$count), then even less names will be returned.&lt;/p&gt;

&lt;p&gt;Potential impact on existing programs is unknown.&lt;/p&gt;</description>
                <environment></environment>
        <key id="27033">LU-5746</key>
            <summary>llapi: fid2path doesn&apos;t return all the names associated with a fid</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="4" iconUrl="https://jira.whamcloud.com/images/icons/priorities/minor.svg">Minor</priority>
                        <status id="5" iconUrl="https://jira.whamcloud.com/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="6">Not a Bug</resolution>
                                        <assignee username="adilger">Andreas Dilger</assignee>
                                    <reporter username="fzago">Frank Zago</reporter>
                        <labels>
                    </labels>
                <created>Wed, 15 Oct 2014 21:22:49 +0000</created>
                <updated>Fri, 17 Oct 2014 20:44:47 +0000</updated>
                            <resolved>Fri, 17 Oct 2014 20:44:47 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                            <comments>
                            <comment id="96444" author="paf" created="Wed, 15 Oct 2014 21:27:45 +0000"  >&lt;p&gt;I&apos;m mostly just free associating, but is there any link to the limit/optimization described by Andreas at the end of the comments here:&lt;br/&gt;
&lt;a href=&quot;https://jira.hpdd.intel.com/browse/LU-2490&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://jira.hpdd.intel.com/browse/LU-2490&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="96447" author="fzago" created="Wed, 15 Oct 2014 21:44:31 +0000"  >&lt;p&gt;In a similar testing, if the length of the link names are 8 characters, 158 entries are returned. As the length grows, less entries are returned. With 63 characters, it&apos;s 55 entries. With 83, it&apos;s 43 entries. At the maximum length (255), only 13 entries are returned.&lt;/p&gt;

&lt;p&gt;The length of the leading path doesn&apos;t appear to have any influence. &lt;/p&gt;</comment>
                            <comment id="96602" author="adilger" created="Fri, 17 Oct 2014 17:37:48 +0000"  >&lt;p&gt;As described in &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-2490&quot; title=&quot;mdd_links_rename error seen on Grove test MDS&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-2490&quot;&gt;&lt;del&gt;LU-2490&lt;/del&gt;&lt;/a&gt; this is essentially working as designed.  The last component of the filename as well as the parent directory FID are stored in each &lt;tt&gt;link&lt;/tt&gt; xattr, so longer filenames will result in fewer entries:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The limit is only for the number of reverse name entries for a single file, stored in the &quot;link&quot; xattr. This is useful for lfs fid2path to generate pathnames from a FID for error reporting or lustre_rsync.&lt;/p&gt;

&lt;p&gt;Beyond the 128 hard link count, the reverse links are dropped, though not as silently as they should be. The limit is due to efficiency - since an xattr is completely searched and rewritten for each link added and removed, it gets into an O(n^2) behaviour if there are too many reverse links. Keeping 128 links was decided as an acceptable real-world usage, and for cases like simul or similar it will still work with lots of links. I think we&apos;re increasing the hard link limit in the &quot;link&quot; xattr as part of the LFSCK changes, because we now allow large xattrs, but I don&apos;t see it ever being unlimited due to O(n^2) slowdowns for updating the xattr.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;If the &lt;tt&gt;large_xattr&lt;/tt&gt; feature is enabled on the MDS, it is able to store more links, but this comes with a noticeable performance cost as the link count increases.  In our surveys of HPC filesystems&lt;span class=&quot;error&quot;&gt;&amp;#91;*&amp;#93;&lt;/span&gt;  there are rarely more than a handful of links on regular files, and having more than a hundred links to a file is basically nonexistent.&lt;/p&gt;

&lt;p&gt;Is this a real problem on a real system, or just something that you found while testing corner conditions?&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;*&amp;#93;&lt;/span&gt; &lt;a href=&quot;http://www.pdsi-scidac.org/fsstats/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.pdsi-scidac.org/fsstats/&lt;/a&gt; has some results, and we&apos;ve asked users to run this tool on their filesystems and send us the output along with &quot;lfs df&quot; and &quot;lfs df -i&quot;.&lt;/p&gt;</comment>
                            <comment id="96625" author="fzago" created="Fri, 17 Oct 2014 18:49:08 +0000"  >&lt;p&gt;This is something I found while writing some test code for the fid API.&lt;br/&gt;
So if it works as designed, you can close this ticket.&lt;/p&gt;</comment>
                    </comments>
                    <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|hzwynb:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>16139</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10060" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Severity</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10022"><![CDATA[3]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                        </customfields>
    </item>
</channel>
</rss>