<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:19:48 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-8698] DNE3: check unknown hash type properly in lmv</title>
                <link>https://jira.whamcloud.com/browse/LU-8698</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;The patch 893ab7479263: &quot;staging: lustre: lmv: try all stripes for&lt;br/&gt;
unknown hash functions&quot; from Aug 16, 2016, leads to the following&lt;br/&gt;
static checker warning:&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;	drivers/staging/lustre/lustre/lmv/lmv_intent.c:397 lmv_intent_lookup()
	error: &apos;tgt&apos; dereferencing possible ERR_PTR()
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&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;drivers/staging/lustre/lustre/lmv/lmv_intent.c
  361                               struct ptlrpc_request **reqp,
   362                               ldlm_blocking_callback cb_blocking,
   363                               __u64 extra_lock_flags)
   364  {
   365          struct lmv_stripe_md *lsm = op_data-&amp;gt;op_mea1;
   366          struct obd_device      *obd = exp-&amp;gt;exp_obd;
   367          struct lmv_obd   *lmv = &amp;amp;obd-&amp;gt;u.lmv;
   368          struct lmv_tgt_desc    *tgt = NULL;
   369          struct mdt_body *body;
   370          &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;                  rc = 0;
   371  
   372          /*
   373           * If it returns ERR_PTR(-EBADFD) then it is an unknown hash type
   374           * it will &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt; all stripes to locate the object
   375           */
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;I have read this comment so I assume that this warning is a false&lt;br/&gt;
positive.&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;   376          tgt = lmv_locate_mds(lmv, op_data, &amp;amp;op_data-&amp;gt;op_fid1);
   377          &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (IS_ERR(tgt) &amp;amp;&amp;amp; (PTR_ERR(tgt) != -EBADFD))
   378                  &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; PTR_ERR(tgt);
   379  
   380          /*
   381           * Both migrating dir and unknown hash dir need to &lt;span class=&quot;code-keyword&quot;&gt;try&lt;/span&gt;
   382           * all of sub-stripes
   383           */
   384          &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (lsm &amp;amp;&amp;amp; !lmv_is_known_hash_type(lsm-&amp;gt;lsm_md_hash_type)) {
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;But really, it&apos;s pretty ugly to assume that -EBADFD implies that lsm is&lt;br/&gt;
non-NULL and lmv_is_known_hash_type() will return false.&lt;/p&gt;


&lt;p&gt;Yes, it might be a bit improper to use -EBADFD here to indicate this&lt;br/&gt;
special scenario, or it can be&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; (IS_ERR(tgt)) {
      &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (PTR_ERR(tgt) != -EBADFD)  /* hmm, &lt;span class=&quot;code-keyword&quot;&gt;this&lt;/span&gt; might not needed, needs
further check */
           &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; PTR_ERR(tgt);

      &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (lsm &amp;amp;&amp;amp; !lmv_is_known_hash_type(lsm-&amp;gt;lsm_md_hash_type)) {
           &#352;&#352;..
      } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
           &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; PTR_ERR(tgt);
      }
}

   385                  struct lmv_oinfo *oinfo = &amp;amp;lsm-&amp;gt;lsm_md_oinfo[0];
   386  
   387                  op_data-&amp;gt;op_fid1 = oinfo-&amp;gt;lmo_fid;
   388                  op_data-&amp;gt;op_mds = oinfo-&amp;gt;lmo_mds;
   389                  tgt = lmv_get_target(lmv, oinfo-&amp;gt;lmo_mds, NULL);
   390                  &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (IS_ERR(tgt))
   391                          &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; PTR_ERR(tgt);
   392          }
   393  
   394          &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!fid_is_sane(&amp;amp;op_data-&amp;gt;op_fid2))
   395                  fid_zero(&amp;amp;op_data-&amp;gt;op_fid2);
   396  
   397          CDEBUG(D_INODE, &lt;span class=&quot;code-quote&quot;&gt;&quot;LOOKUP_INTENT with fid1=&quot;&lt;/span&gt; DFID &lt;span class=&quot;code-quote&quot;&gt;&quot;, fid2=&quot;&lt;/span&gt; DFID &lt;span class=&quot;code-quote&quot;&gt;&quot;, name=&lt;span class=&quot;code-quote&quot;&gt;&apos;%s&apos;&lt;/span&gt; -&amp;gt; mds #%u lsm=%p lsm_magic=%x\n&quot;&lt;/span&gt;,
   398                 PFID(&amp;amp;op_data-&amp;gt;op_fid1), PFID(&amp;amp;op_data-&amp;gt;op_fid2),
   399                 op_data-&amp;gt;op_name ? op_data-&amp;gt;op_name : &lt;span class=&quot;code-quote&quot;&gt;&quot;&amp;lt;NULL&amp;gt;&quot;&lt;/span&gt;,
   400                 tgt-&amp;gt;ltd_idx, lsm, !lsm ? -1 : lsm-&amp;gt;lsm_md_magic);
   401  
   402          op_data-&amp;gt;op_bias &amp;amp;= ~MDS_CROSS_REF;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="40531">LU-8698</key>
            <summary>DNE3: check unknown hash type properly in lmv</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="10000">Done</resolution>
                                        <assignee username="wc-triage">WC Triage</assignee>
                                    <reporter username="di.wang">Di Wang</reporter>
                        <labels>
                            <label>dne3</label>
                    </labels>
                <created>Wed, 12 Oct 2016 16:54:17 +0000</created>
                <updated>Fri, 1 Apr 2022 00:26:39 +0000</updated>
                            <resolved>Fri, 1 Apr 2022 00:26:39 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                            <comments>
                            <comment id="267094" author="adilger" created="Tue, 7 Apr 2020 22:18:26 +0000"  >&lt;p&gt;Lai, I think this is already handled with the directory restriping code, maybe even in 2.13?  If yes, please link to the ticket/patch that fixed this problem and close it.&lt;/p&gt;

&lt;p&gt;Is it possible to migrate a directory with an unknown hash type to a new type?  This should work for any hash type, and just result in all directory stripes being walked and all entries being rehashed to new stripes.  I think this is done with patch &lt;a href=&quot;https://review.whamcloud.com/36898&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/36898&lt;/a&gt; &quot;&lt;tt&gt;&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11025&quot; title=&quot;DNE3: directory restripe&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11025&quot;&gt;&lt;del&gt;LU-11025&lt;/del&gt;&lt;/a&gt; dne: support directory restripe&lt;/tt&gt;&quot;, but it would be good to confirm (maybe add a &lt;tt&gt;fail_loc&lt;/tt&gt; that allows setting an arbitrary &lt;tt&gt;lmv_hash_type=fail_val&lt;/tt&gt; for testing).&lt;/p&gt;

&lt;p&gt;This will allow recovering from a corrupted LMV EA, or if someone does upgrade, create directory with new hash, then downgrade, or if someone has a custom hash function that is not landed to mainline Lustre.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="52253">LU-11025</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="24267">LU-4921</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|hzyrk7:</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>
                                                                                            <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>