<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:42:30 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-4414] ostid_id() returns incorrect OID for IDIF FIDs</title>
                <link>https://jira.whamcloud.com/browse/LU-4414</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;It looks like the implementation of ostid_id() will return an incorrect OID value if passed an IDIF FID.  The problem is that ostid_seq() will return FID_SEQ_OST_MDT0 for IDIF FIDs, which helps in the osd layer to map the IDIF SEQ to the &lt;tt&gt;O/0/&lt;/tt&gt; directory.  However, this confuses ostid_id() into thinking that &quot;oi.oi_id&quot; is holding the OID value for the IDIF FID due to fid_seq_is_mdt0(ostid_seq()) returning true, when in fact it should continue down to the fid_seq_is_idif() case.&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-comment&quot;&gt;/* extract OST sequence (group) from a wire ost_id (id/seq) pair */&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; inline obd_seq ostid_seq(&lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; struct ost_id *ostid)
{
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (fid_seq_is_mdt0(ostid-&amp;gt;oi.oi_seq))
                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; FID_SEQ_OST_MDT0;

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (fid_seq_is_default(ostid-&amp;gt;oi.oi_seq))
                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; FID_SEQ_LOV_DEFAULT;

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (fid_is_idif(&amp;amp;ostid-&amp;gt;oi_fid))
                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; FID_SEQ_OST_MDT0;

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; fid_seq(&amp;amp;ostid-&amp;gt;oi_fid);
}

&lt;span class=&quot;code-comment&quot;&gt;/* extract OST objid from a wire ost_id (id/seq) pair */&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; inline obd_id ostid_id(&lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; struct ost_id *ostid)
{
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (fid_seq_is_mdt0(ostid-&amp;gt;oi.oi_seq))   &amp;lt;&amp;lt;&amp;lt; always &lt;span class=&quot;code-keyword&quot;&gt;true&lt;/span&gt; &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; IDIF
                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; ostid-&amp;gt;oi.oi_id &amp;amp; IDIF_OID_MASK;

        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (fid_is_idif(&amp;amp;ostid-&amp;gt;oi_fid))         &amp;lt;&amp;lt;&amp;lt; IDIF never gets to here
                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; fid_idif_id(fid_seq(&amp;amp;ostid-&amp;gt;oi_fid),
                                   fid_oid(&amp;amp;ostid-&amp;gt;oi_fid), 0);

        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; fid_oid(&amp;amp;ostid-&amp;gt;oi_fid);
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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;diff --git a/lustre/include/lustre/lustre_idl.h b/lustre/include/lustre/lustre_idl.h
index 8b835a5..72b8380 100644
--- a/lustre/include/lustre/lustre_idl.h
+++ b/lustre/include/lustre/lustre_idl.h
@@ -646,7 +646,7 @@ static inline obd_seq ostid_seq(const struct ost_id *ostid)
 /* extract OST objid from a wire ost_id (id/seq) pair */
 static inline obd_id ostid_id(const struct ost_id *ostid)
 {
-       if (fid_seq_is_mdt0(ostid_seq(ostid)))
+       if (fid_seq_is_mdt0(ostid-&amp;gt;oi.oi_seq))
                return ostid-&amp;gt;oi.oi_id &amp;amp; IDIF_OID_MASK;
 
        if (fid_is_idif(&amp;amp;ostid-&amp;gt;oi_fid))
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;I&apos;m not sure if this will cause problems for DNE, but it will definitely cause problems if clients ever send IDIF FIDs, or if ostid is converted to IDIF at the OST level.&lt;/p&gt;</description>
                <environment></environment>
        <key id="22566">LU-4414</key>
            <summary>ostid_id() returns incorrect OID for IDIF FIDs</summary>
                <type id="7" iconUrl="https://jira.whamcloud.com/images/icons/issuetypes/task_agile.png">Technical task</type>
                            <parent id="19716">LU-3569</parent>
                                    <priority id="2" iconUrl="https://jira.whamcloud.com/images/icons/priorities/critical.svg">Critical</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="di.wang">Di Wang</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                            <label>mn4</label>
                            <label>mq414</label>
                    </labels>
                <created>Tue, 24 Dec 2013 00:41:19 +0000</created>
                <updated>Thu, 10 Dec 2015 18:17:04 +0000</updated>
                            <resolved>Thu, 10 Dec 2015 18:17:04 +0000</resolved>
                                                    <fixVersion>Lustre 2.8.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                            <comments>
                            <comment id="74499" author="adilger" created="Tue, 7 Jan 2014 19:09:03 +0000"  >&lt;p&gt;The &lt;a href=&quot;http://review.whamcloud.com/7053&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/7053&lt;/a&gt; patch will fix this in master, but that is probably larger than we want for b2_4 and b2_5.  I think a simple patch to just change fid_seq_is_mdt0(ostid_seq(ostid-&amp;gt;oi)) to fid_seq_is_mdt0(ostid-&amp;gt;oi.oi_seq) is enough.&lt;/p&gt;</comment>
                            <comment id="135892" author="jgmitter" created="Thu, 10 Dec 2015 18:17:04 +0000"  >&lt;p&gt;&lt;a href=&quot;http://review.whamcloud.com/7053&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/7053&lt;/a&gt; landed to master to address this subtask of &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-3569&quot; title=&quot;Use real OST index as ostid_to_fid() parameter instead of always &amp;quot;0&amp;quot;&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-3569&quot;&gt;&lt;del&gt;LU-3569&lt;/del&gt;&lt;/a&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="19716">LU-3569</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </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|hzwbtr:</customfieldvalue>

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