<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:51:39 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-12332] Add a liblustreapi call for IOC_MDC_GETFILEINFO</title>
                <link>https://jira.whamcloud.com/browse/LU-12332</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;&lt;tt&gt;IOC_MDC_GETFILEINFO&lt;/tt&gt; is a very convenient ioctl to retrieve metadata information (stat + lov EA v1) from MDT. This avoid going to OSTs if you don&apos;t need information stored over there (like file size).&lt;/p&gt;

&lt;p&gt;This is wrapped by :&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;
&#160;&lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; get_lmd_info_fd(&lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt; *path, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; parent_fd, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; dir_fd,
&#160;&#160;&#160;                &#160; void *lmdbuf, &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; lmdlen, &lt;span class=&quot;code-keyword&quot;&gt;enum&lt;/span&gt; get_lmd_info_type type)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;but this function is not exported and it could be nice to also add a llapi prefix.&lt;/p&gt;</description>
                <environment></environment>
        <key id="55729">LU-12332</key>
            <summary>Add a liblustreapi call for IOC_MDC_GETFILEINFO</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="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="1">Fixed</resolution>
                                        <assignee username="wc-triage">WC Triage</assignee>
                                    <reporter username="degremoa">Aurelien Degremont</reporter>
                        <labels>
                    </labels>
                <created>Thu, 23 May 2019 09:16:55 +0000</created>
                <updated>Tue, 28 Jul 2020 23:46:24 +0000</updated>
                            <resolved>Tue, 28 Jul 2020 23:46:24 +0000</resolved>
                                                    <fixVersion>Lustre 2.13.0</fixVersion>
                    <fixVersion>Lustre 2.14.0</fixVersion>
                    <fixVersion>Lustre 2.12.4</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                            <comments>
                            <comment id="247608" author="adilger" created="Fri, 24 May 2019 00:14:16 +0000"  >&lt;p&gt;Aurelien, thanks for filing this ticket, it is something that I&apos;ve been meaning to do as well.&lt;/p&gt;

&lt;p&gt;The patch &lt;a href=&quot;https://review.whamcloud.com/33545&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/33545&lt;/a&gt; adds functionality to &lt;tt&gt;IOC_MDC_GETFILEINFO&lt;/tt&gt; so that it can optionally return the Lazy Size-on-MDT data from the initial MDS RPC, so that tools such as &quot;&lt;tt&gt;lfs find&quot;&lt;/tt&gt; and other scanners can use this as the approximate file size, instead of having to do an extra &lt;tt&gt;stat()&lt;/tt&gt; on the file each time to get the size/blocks.&lt;/p&gt;

&lt;p&gt;As such, I&apos;d like to plumb in the &lt;tt&gt;llapi_&amp;#42;&lt;/tt&gt; interface for this command to include the &quot;&lt;tt&gt;__u64 lmd_flags&lt;/tt&gt;&quot; an argument, and separate out the pointer to &quot;&lt;tt&gt;struct stat&lt;/tt&gt;&quot; from &quot;&lt;tt&gt;struct lov_user_md&lt;/tt&gt;&quot; so that it is isolated from the underlying ioctl interface a bit.  That allows the internals to call either &lt;tt&gt;IOC_MDC_GETFILEINFO&lt;/tt&gt; or &lt;tt&gt;IOC_MDC_GETFILEINFO_OLD&lt;/tt&gt; depending on which command the kernel supports without having to expose this to userspace.  As such, I don&apos;t think that just renaming &lt;tt&gt;get_lmd_info_fd()&lt;/tt&gt; is the right way to go.&lt;/p&gt;</comment>
                            <comment id="247623" author="degremoa" created="Fri, 24 May 2019 07:03:36 +0000"  >&lt;p&gt;Actually I was also thinking about add a call which was not exactly &lt;tt&gt;get_lmd_info_fd()&lt;/tt&gt; but take this opportunity to improve that a little bit. Your proposal makes sense.&lt;/p&gt;

&lt;p&gt;Enabling this call to return more information in one RPC is interesting. Tools like Robinhood can benefit from a call which &quot;give me everything in 1 RPC&quot;, like stats, layout, ...&lt;/p&gt;

&lt;p&gt;So, whatever this call will return with 1 RPC, the more, the better&lt;/p&gt;</comment>
                            <comment id="253863" author="nrutman" created="Thu, 29 Aug 2019 18:08:32 +0000"  >&lt;p&gt;This ticket seems to be addressed by &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11367&quot; title=&quot;integrate LSOM with lfs find&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11367&quot;&gt;&lt;del&gt;LU-11367&lt;/del&gt;&lt;/a&gt; patch&lt;br/&gt;
&lt;a href=&quot;https://review.whamcloud.com/#/c/35167/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/#/c/35167/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;int llapi_get_lum_file_fd(int dir_fd, const char *fname, __u64 *valid,&lt;br/&gt;
			  lstatx_t *statx, struct lov_user_md *lum,&lt;br/&gt;
			  size_t lumsize);&lt;/p&gt;</comment>
                            <comment id="253866" author="nrutman" created="Thu, 29 Aug 2019 18:40:15 +0000"  >&lt;p&gt;I don&apos;t want to hold up the landing of &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11367&quot; title=&quot;integrate LSOM with lfs find&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11367&quot;&gt;&lt;del&gt;LU-11367&lt;/del&gt;&lt;/a&gt;, but it&apos;s not quite ideal yet.&lt;/p&gt;

&lt;p&gt;llapi_get_lum_file_fd requires an open parent directory FD to send the ioctl to. It looks like this has to be the direct parent given the strrchr call in get_lmd_info_fd, rather than a true &quot;path relative to the parent fd&quot;, which might allow us to issue the ioctl on the FS root in all cases, and avoid opening the parent dirs. &lt;/p&gt;

&lt;p&gt;Since both stat() and getfattr() can be issued against the path with no opens, it seems like the info should be obtainable with even fewer RPCs. For example, llapi_get_lum_file could, instead of opening the parent dir and calling get_lum_file_fd, just call stat and getfattr lustre.lov, and avoid the open. Of course, stat and getfattr are two calls - but in reality we know that the stat() has already retrieved the layout info (because it needs to talk to the OSTs for size). So this is my long-winded way of asking: why can&apos;t we get all the info we want for the cost of a single stat()?&lt;/p&gt;
</comment>
                            <comment id="253915" author="degremoa" created="Fri, 30 Aug 2019 08:48:22 +0000"  >&lt;p&gt;&amp;gt; why can&apos;t we get all the info we want for the cost of a single stat()?&lt;/p&gt;

&lt;p&gt;&#160;Because stat() will also send RPCs to OSTs and this is what we want to avoid, no?&lt;/p&gt;</comment>
                            <comment id="253943" author="nrutman" created="Fri, 30 Aug 2019 15:40:06 +0000"  >&lt;p&gt;&amp;gt; Because stat() will also send RPCs to OSTs and this is what we want to avoid, no?&lt;br/&gt;
Perhaps better phrased as &quot;the cost of a single RPC&quot;. My point is that a stat() call gets all the metadata that the MDS holds, both the MD in the inode and the layout, for the cost of a single ldlm_ibits_enqueue call to the MDS. At that point, all the info (except size) is available on the client, without an &quot;open&quot;.&lt;/p&gt;

&lt;p&gt;If we filled in the stat size with lazy some data, and interrupted the stat on the client before it tried to get the size from the OSTs, we would have everything that llapi_get_lum_file_fd has, with a single RPC.&lt;/p&gt;

&lt;p&gt;Having said all that:&lt;br/&gt;
&amp;gt;RPCs to OSTs and this is what we want to avoid&lt;br/&gt;
Interestingly: no. That has always been the assumption, that &quot;stats are slow because they have to go to OSTs&quot;. But that doesn&apos;t actually seem to be the case. We can get very high stat rates, even going to OSTs. The problem really seems to be RPCs to the MDS, and reducing the MDS RPC count is actually the win. In particular, directory open on MDS is slow, maybe because of locks, so it&apos;s likely (although I haven&apos;t tested) that the ioctl is slower that the stat, even including OST RPCs. &lt;/p&gt;</comment>
                            <comment id="276251" author="adilger" created="Tue, 28 Jul 2020 23:46:24 +0000"  >&lt;p&gt;The new llapi was added as part of &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11367&quot; title=&quot;integrate LSOM with lfs find&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11367&quot;&gt;&lt;del&gt;LU-11367&lt;/del&gt;&lt;/a&gt; (in 2.13.0 and 2.12.4).&lt;/p&gt;

&lt;p&gt;The ability to selectively get file attributes (without doing an OST RPC) is added with the &lt;tt&gt;statx()&lt;/tt&gt; API in &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-10934&quot; title=&quot;integrate statx() API with Lustre&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-10934&quot;&gt;&lt;del&gt;LU-10934&lt;/del&gt;&lt;/a&gt; in 2.14.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="53281">LU-11367</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="51920">LU-10934</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="54095">LU-11695</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|i00gu7:</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>