<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:34:36 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-3519] EIO on directory access</title>
                <link>https://jira.whamcloud.com/browse/LU-3519</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;We have found two directories on our lscratchc filesystem for which getdents() returns EIO.  This error occurs on all clients and across reboots/remounts.  Analysis below suggests a client-side page caching problem.  No &lt;tt&gt;MDS_READPAGE&lt;/tt&gt; RPC is ever sent.&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;# cab14 /root &amp;gt; strace -e trace=getdents ls /p/lscratchc/hood/Ag/s_local/fcc
getdents(3, 0x61fcc8, 32768)            = -1 EIO (Input/output error)
ls: reading directory /p/lscratchc/hood/Ag/s_local/fcc: Input/output error
# cab14 /root &amp;gt; dmesg | tail
LustreError: 123961:0:(dir.c:477:ll_get_dir_page()) read cache page: [0x38353ea534c:0x1:0x0] at 0: rc -5
LustreError: 123961:0:(dir.c:648:ll_readdir()) error reading dir [0x38353ea534c:0x1:0x0] at 0: rc -5
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;No errors appear on the servers.&lt;/p&gt;

&lt;p&gt;With &lt;tt&gt;+vfstrace +trace&lt;/tt&gt; debugging on the client we get:&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;00000002:00000001:7.0:1370559009.547576:0:20012:0:(mdc_locks.c:159:mdc_set_lock_data()) Process leaving (rc=0 : 0 : 0)
00000080:00000001:7.0:1370559009.547577:0:20012:0:(obd_class.h:2119:md_set_lock_data()) Process leaving (rc=0 : 0 : 0)
00000080:00020000:7.0:1370559009.547581:0:20012:0:(dir.c:438:ll_get_dir_page()) dir page locate: [0x38353ea534c:0x1:0x0] at 0: rc -5
00000080:00000001:7.0:1370559009.557292:0:20012:0:(dir.c:439:ll_get_dir_page()) Process leaving via out_unlock (rc=18446744073709551611 : -5 : 0xfffffffffffffffb)
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;                                                                      
&lt;p&gt;Corresponding code in &lt;tt&gt;ll_get_dir_page()&lt;/tt&gt;:&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; 426         } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {                                                                
 427                 /* &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; cross-ref object, l_ast_data of the lock may not be set, 
 428                  * we reset it here */                                          
 429                 md_set_lock_data(ll_i2sbi(dir)-&amp;gt;ll_md_exp, &amp;amp;lockh.cookie,       
 430                                  dir, NULL);                                    
 431         }                                                                       
 432         ldlm_lock_dump_handle(D_OTHER, &amp;amp;lockh);                                 
 433                                                                                 
 434         cfs_down(&amp;amp;lli-&amp;gt;lli_readdir_sem);                                        
 435         page = ll_dir_page_locate(dir, &amp;amp;lhash, &amp;amp;start, &amp;amp;end);                   
 436         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (IS_ERR(page)) {                                                     
 437                 CERROR(&lt;span class=&quot;code-quote&quot;&gt;&quot;dir page locate: &quot;&lt;/span&gt;DFID&lt;span class=&quot;code-quote&quot;&gt;&quot; at &quot;&lt;/span&gt;LPU64&lt;span class=&quot;code-quote&quot;&gt;&quot;: rc %ld\n&quot;&lt;/span&gt;,          
 438                        PFID(ll_inode2fid(dir)), lhash, PTR_ERR(page));          
 439                 GOTO(out_unlock, page);                                         
 440         }                           
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;                                                                      

&lt;p&gt;Looking at the source for &lt;tt&gt;ll_dir_page_locate()&lt;/tt&gt;,&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;                                                                      
 340                 &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (PageUptodate(page)) {                                       
...                                                                             
 352                         CDEBUG(D_VFSTRACE, &lt;span class=&quot;code-quote&quot;&gt;&quot;page %lu [%llu %llu], hash &quot;&lt;/span&gt;LPU64&lt;span class=&quot;code-quote&quot;&gt;&quot;\n&quot;&lt;/span&gt;,
...                                                                             
 369                 } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {                                                        
 370                         page_cache_release(page);                               
 371                         page = ERR_PTR(-EIO);                                   
 372                 }                                                          
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;                                                                      

&lt;p&gt;It looks like the page that it finds using &lt;tt&gt;radix_tree_gang_lookup()&lt;/tt&gt; fails &lt;tt&gt;PageUptodate(page)&lt;/tt&gt; which results in &lt;tt&gt;EIO&lt;/tt&gt; being returned.&lt;/p&gt;

&lt;p&gt;The FIDs of the two directories are &lt;span class=&quot;error&quot;&gt;&amp;#91;0x6da716ef142:0x1:0x0&amp;#93;&lt;/span&gt; and &lt;span class=&quot;error&quot;&gt;&amp;#91;0x38353ea534c:0x1:0x0&amp;#93;&lt;/span&gt;.  Note that we have burned through a huge number of FID sequences on this filesystem due to &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-1632&quot; title=&quot;FID sequence numbers not working properly with filesystems formatted using 1.8?&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-1632&quot;&gt;&lt;del&gt;LU-1632&lt;/del&gt;&lt;/a&gt;.  I wonder if we&apos;ve stumbled on a few &quot;magic&quot; numbers that expose a strange corner-case in the hashing code.&lt;/p&gt;

&lt;p&gt;LLNL-bug-ID: TOSS-2026&lt;/p&gt;</description>
                <environment>client and server: lustre-2.1.4-5chaos_2.6.32_358.6.1.3chaos.ch5.1.x86_64.x86_64</environment>
        <key id="19583">LU-3519</key>
            <summary>EIO on directory access</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.whamcloud.com/images/icons/priorities/critical.svg">Critical</priority>
                        <status id="6" iconUrl="https://jira.whamcloud.com/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="3">Duplicate</resolution>
                                        <assignee username="di.wang">Di Wang</assignee>
                                    <reporter username="nedbass">Ned Bass</reporter>
                        <labels>
                    </labels>
                <created>Wed, 26 Jun 2013 23:12:14 +0000</created>
                <updated>Wed, 3 Jul 2013 21:04:37 +0000</updated>
                            <resolved>Wed, 3 Jul 2013 21:04:37 +0000</resolved>
                                    <version>Lustre 2.1.4</version>
                                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                            <comments>
                            <comment id="61430" author="pjones" created="Thu, 27 Jun 2013 05:12:19 +0000"  >&lt;p&gt;Di&lt;/p&gt;

&lt;p&gt;Could you please comment?&lt;/p&gt;

&lt;p&gt;Thanks&lt;/p&gt;

&lt;p&gt;Peter&lt;/p&gt;</comment>
                            <comment id="61511" author="nedbass" created="Fri, 28 Jun 2013 19:42:11 +0000"  >&lt;p&gt;On closer inspection, it appears the EIO error is originating from the MDS.  The debug data above was taken after the client had cached the directory page.  With a cold cache on the client, I see the error coming from here on the MDS (line 3639 below).  So we may just have some on-disk corruption on the MDT and need to run fsck.&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;00000004:00000001:10.0:1372447578.208371:0:21576:0:(osd_handler.c:3628:osd_ldiskfs_it_fill()) Process entered
00000004:00000001:10.0:1372447578.208372:0:21576:0:(osd_handler.c:3645:osd_ldiskfs_it_fill()) Process leaving (rc=18446744073709551611 : -5 : fffffffffffffffb)
00000004:00000001:10.0:1372447578.208373:0:21576:0:(osd_handler.c:3680:osd_it_ea_next()) Process leaving (rc=18446744073709551611 : -5 : fffffffffffffffb)
00000004:00000400:10.0:1372447578.208374:0:21576:0:(mdd_object.c:2441:__mdd_readpage()) build page failed: -5!
&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;3621 &lt;span class=&quot;code-keyword&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; osd_ldiskfs_it_fill(&lt;span class=&quot;code-keyword&quot;&gt;const&lt;/span&gt; struct dt_it *di)
3622 {
3623         struct osd_it_ea   *it    = (struct osd_it_ea *)di;
3624         struct osd_object  *obj   = it-&amp;gt;oie_obj;
3625         struct inode       *inode = obj-&amp;gt;oo_inode;
3626         &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt;                result = 0;
3627 
3628         ENTRY;
3629         it-&amp;gt;oie_dirent = it-&amp;gt;oie_buf;
3630         it-&amp;gt;oie_rd_dirent = 0;
3631 
3632         cfs_down_read(&amp;amp;obj-&amp;gt;oo_ext_idx_sem);
3633         result = inode-&amp;gt;i_fop-&amp;gt;readdir(&amp;amp;it-&amp;gt;oie_file, it,
3634                                        (filldir_t) osd_ldiskfs_filldir);
3635 
3636         cfs_up_read(&amp;amp;obj-&amp;gt;oo_ext_idx_sem);
3637 
3638         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (it-&amp;gt;oie_rd_dirent == 0) {
3639                 result = -EIO;
3640         } &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt; {
3641                 it-&amp;gt;oie_dirent = it-&amp;gt;oie_buf;
3642                 it-&amp;gt;oie_it_dirent = 1;
3643         }
3644 
3645         RETURN(result);
3646 }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="61699" author="nedbass" created="Tue, 2 Jul 2013 21:13:38 +0000"  >&lt;p&gt;I found that the affected directories both have entries with a corrupt rec_len field.&lt;/p&gt;

&lt;p&gt;For example, the last block allocated to one directory is 311251665.  We dump that block and find the directory entry for the last file output from &lt;tt&gt;debugfs.ldiskfs ls&lt;/tt&gt;:&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;# sumom-mds1 /root &amp;gt; debugfs.ldiskfs -c -R &apos;ls /ROOT/hood/Ag/s_local/fcc&apos; /dev/sdb  | tail -2
debugfs.ldiskfs 1.42.3.wc1.1chaos (28-May-2012)
/dev/sdb: catastrophic mode - not reading inode or group bitmaps
 622493978  (216) ag_4x4x4_7.78_1c    622493988  (24) ag_4x4x4_7.80_2c   
 622494005  (2144) ag_4x4x4_7.842_4c   
# sumom-mds1 /root &amp;gt; printf &quot;%x\n&quot; 622494005
251a8135

# sumom-mds1 /root &amp;gt; dd if=/dev/sdb skip=311251665 bs=4k count=1 | hexdump -C | less
[snip]
000007a0  35 81 1a 25 60 08 11 01  61 67 5f 34 78 34 78 34  |5..%`...ag_4x4x4|
000007b0  5f 37 2e 38 34 32 5f 34  63 80 1a 25 ca 85 1a 25  |_7.842_4c..%...%|
000007c0  40 00 18 01 61 67 5f 34  78 34 78 34 5f 37 2e 38  |@...ag_4x4x4_7.8|
[snip]
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;


&lt;p&gt;This directory does not have EXT4_INDEX_FL flag set, so it using a linear array of ext4_dir_entry_2:&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;struct ext4_dir_entry_2 {                                                       
        __le32  inode;                  &lt;span class=&quot;code-comment&quot;&gt;/* Inode number */&lt;/span&gt;                      
        __le16  rec_len;                &lt;span class=&quot;code-comment&quot;&gt;/* Directory entry length */&lt;/span&gt;            
        __u8    name_len;               &lt;span class=&quot;code-comment&quot;&gt;/* Name length */&lt;/span&gt;                       
        __u8    file_type;                                                      
        &lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt;    name[EXT4_NAME_LEN];    &lt;span class=&quot;code-comment&quot;&gt;/* File name */&lt;/span&gt;                         
};      
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The dirent for our inode 622494005 begins on line 000007a0 above.  Note the rec_len value is 0x860, or 2144 bytes, which the other fields appear intact.  The expected value is 28 (0x1c).  Repeating this analysis for the other bad directory also found an invalid rec_len value of 1780 (0x6f4) with other fields intact.  This pattern makes me wonder if a Lustre or ldiskfs bug is corrupting this field.&lt;/p&gt;</comment>
                            <comment id="61714" author="nedbass" created="Tue, 2 Jul 2013 22:50:33 +0000"  >&lt;p&gt;Nevermind, it looks like those are valid rec_len values after all. The size of the last entry is always large enough to span to the end of the block.&lt;/p&gt;</comment>
                            <comment id="61725" author="nedbass" created="Wed, 3 Jul 2013 05:22:51 +0000"  >&lt;p&gt;I believe the error occurs for directories that don&apos;t have EXT4_INDEX_FL and that span multiple extents.  I&apos;m not sure how these directories came to exist on our filesystem.  Perhaps they existed before we upgraded from 1.8, although I think their creation date is more recent than the upgrade.&lt;/p&gt;

&lt;p&gt;I can reproduce this on a test filesystem by mounting the MDT with the dir_index feature disabled, create a directory from a client with about 500 files, then remounting the MDT with dir_index reenabled.  Then getdents() on the new directory returns EIO as described above.&lt;/p&gt;</comment>
                            <comment id="61789" author="nedbass" created="Wed, 3 Jul 2013 21:04:37 +0000"  >&lt;p&gt;Closing as duplicate of &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-2627&quot; title=&quot;/bin/ls gets Input/output error&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-2627&quot;&gt;&lt;del&gt;LU-2627&lt;/del&gt;&lt;/a&gt;.  I will create a follow-on ticket to improve handling of large non-dx directories created as a result of &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-2638&quot; title=&quot;corruption of MDT &amp;quot;..&amp;quot; entry in some ldiskfs directories&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-2638&quot;&gt;&lt;del&gt;LU-2638&lt;/del&gt;&lt;/a&gt;.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="17194">LU-2627</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|hzvu4f:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10090" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>8853</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>