<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:45:12 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-11589] kernel BUG at ldiskfs.h:1907!</title>
                <link>https://jira.whamcloud.com/browse/LU-11589</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;After a filesystem corruption event and e2fsck 1.44.3.wc1 running to repair it, the server keeps crashing with the following error:&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: nbp13-OST0008: trigger OI scrub by RPC for the [0x100080000:0x217edd:0x0] with flags 0x4a, rc = 0
------------[ cut here ]------------
kernel BUG at /tmp/rpmbuild-lustre-jlan-ItUrr9b3/BUILD/lustre-2.10.5/ldiskfs/ldiskfs.h:1907!
invalid opcode: 0000 [#1] SMP 
CPU: 5 PID: 11348 Comm: lfsck Tainted: G           OE  ------------   3.10.0-693.21.1.el7.20180508.x86_64.lustre2105 #1
RIP: 0010:[&amp;lt;ffffffffa10fbd04&amp;gt;]  [&amp;lt;ffffffffa10fbd04&amp;gt;] ldiskfs_rec_len_to_disk.part.9+0x4/0x10 [ldiskfs]
Call Trace:
   htree_inlinedir_to_tree+0x445/0x450 [ldiskfs]
   ldiskfs_htree_fill_tree+0x137/0x2f0 [ldiskfs]
   ldiskfs_readdir+0x61c/0x850 [ldiskfs]
   osd_ldiskfs_it_fill+0xbe/0x260 [osd_ldiskfs]
   osd_it_ea_load+0x37/0x100 [osd_ldiskfs]
   lfsck_open_dir+0x11c/0x3a0 [lfsck]
   lfsck_master_oit_engine+0x9a2/0x1190 [lfsck]
   lfsck_master_engine+0x8f6/0x1360 [lfsck]
   kthread+0xd1/0xe0
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="53868">LU-11589</key>
            <summary>kernel BUG at ldiskfs.h:1907!</summary>
                <type id="7" iconUrl="https://jira.whamcloud.com/images/icons/issuetypes/task_agile.png">Technical task</type>
                            <parent id="26471">LU-5603</parent>
                                    <priority id="2" iconUrl="https://jira.whamcloud.com/images/icons/priorities/critical.svg">Critical</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="wc-triage">WC Triage</assignee>
                                    <reporter username="adilger">Andreas Dilger</reporter>
                        <labels>
                            <label>easy</label>
                            <label>ldiskfs</label>
                    </labels>
                <created>Wed, 31 Oct 2018 22:40:05 +0000</created>
                <updated>Thu, 20 Jan 2022 23:54:48 +0000</updated>
                                            <version>Lustre 2.10.5</version>
                                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                            <comments>
                            <comment id="236089" author="adilger" created="Wed, 31 Oct 2018 22:43:43 +0000"  >&lt;p&gt;Making this a separate ticket, since it looks like it is a bug in the &lt;tt&gt;inline_data&lt;/tt&gt; handling in ldiskfs.  The code in question is:&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;static&lt;/span&gt; inline __le16 ldiskfs_rec_len_to_disk(unsigned len, unsigned blocksize)
{                                                       
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; ((len &amp;gt; blocksize) || (blocksize &amp;gt; (1 &amp;lt;&amp;lt; 18)) || (len &amp;amp; 3))
                BUG();
#&lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (PAGE_CACHE_SIZE &amp;gt;= 65536)
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (len &amp;lt; 65536)
                &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; cpu_to_le16(len);
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (len == blocksize) {
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (blocksize == 65536)
                        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; cpu_to_le16(LDISKFS_MAX_REC_LEN);
                &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;              
                        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; cpu_to_le16(0);
        }
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; cpu_to_le16((len &amp;amp; 65532) | ((len &amp;gt;&amp;gt; 16) &amp;amp; 3));
#&lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;           
        &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; cpu_to_le16(len);
#endif
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;which has &lt;tt&gt;BUG()&lt;/tt&gt; as an error handling mechanism.  We should never BUG() when processing data from disk.  In this case, the problem is that the calling convention of &lt;tt&gt;ldiskfs_rec_len_to_disk()&lt;/tt&gt; means there is no way to return an error to the caller.  That means we can only pass verified values to this function, or change the function to take &lt;tt&gt;rec_len&lt;/tt&gt; as an argument and return 0 or an error code.&lt;/p&gt;</comment>
                            <comment id="236092" author="dongyang" created="Wed, 31 Oct 2018 23:52:06 +0000"  >&lt;p&gt;I think the real issue here is in the&#160;ext4-data-in-dirent.patch:&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;
@@ -1348,7 +1348,7 @@ &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; htree_inlinedir_to_tree(struct file
                        fake.name_len = 1;
                        strcpy(fake.name, &lt;span class=&quot;code-quote&quot;&gt;&quot;.&quot;&lt;/span&gt;);
                        fake.rec_len = ext4_rec_len_to_disk(
-                                               EXT4_DIR_REC_LEN(fake.name_len),
+                                               EXT4_DIR_REC_LEN(&amp;amp;fake),
                                                inline_size);
                        ext4_set_de_type(inode-&amp;gt;i_sb, &amp;amp;fake, S_IFDIR);
                        de = &amp;amp;fake;
@@ -1358,7 +1358,7 @@ &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; htree_inlinedir_to_tree(struct file
                        fake.name_len = 2;
                        strcpy(fake.name, &lt;span class=&quot;code-quote&quot;&gt;&quot;..&quot;&lt;/span&gt;);
                        fake.rec_len = ext4_rec_len_to_disk(
-                                               EXT4_DIR_REC_LEN(fake.name_len),
+                                               EXT4_DIR_REC_LEN(&amp;amp;fake),
                                                inline_size);
                        ext4_set_de_type(inode-&amp;gt;i_sb, &amp;amp;fake, S_IFDIR);
                        de = &amp;amp;fake;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;The new EXT4_DIR_REC_LEN introduced by dirdata calls&#160;ext4_get_dirent_data_len(de), in this case the de is just on the stack and contains garbage, so the BUG() was triggered when we pass the value to ext4_rec_len_to_disk.&lt;/p&gt;

&lt;p&gt;We should use&#160;__EXT4_DIR_REC_LEN(fake.name_len) instead.&lt;/p&gt;</comment>
                            <comment id="236099" author="adilger" created="Thu, 1 Nov 2018 02:42:36 +0000"  >&lt;p&gt;So in this case, the BUG() seems warranted...&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10324">
                    <name>Cloners</name>
                                            <outwardlinks description="Clones">
                                        <issuelink>
            <issuekey id="53850">LU-11584</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="26471">LU-5603</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|i005fb:</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>