<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:29:00 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-2880] ldiskfs getdents() returns invalid d_types </title>
                <link>https://jira.whamcloud.com/browse/LU-2880</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Note this is not a bug in lustre but in ldisks as a top level filesystem. The d_types returned have an extra bit set (perhaps from putting FIDs in dirents). The most annoying symptom of this is that it breaks find.&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;# llmount.sh
...
# mkdir -p /mnt/lustre/D/D/D/D/D/D
# touch /mnt/lustre/D/D/D/D/D/D/XXX
# find /mnt/lustre
/mnt/lustre
/mnt/lustre/.lustre
/mnt/lustre/D
/mnt/lustre/D/D
/mnt/lustre/D/D/D
/mnt/lustre/D/D/D/D
/mnt/lustre/D/D/D/D/D
/mnt/lustre/D/D/D/D/D/D
/mnt/lustre/D/D/D/D/D/D/XXX
# umount /mnt/lustre /mnt/mds1
#
# mount /tmp/lustre-mdt1 /mnt/mds1 -t ldiskfs -o loop,ro
# find /mnt/mds1/ROOT -name XXX
# stat /mnt/mds1/ROOT/D/D/D/D/D/D/XXX
  File: `/mnt/mds1/ROOT/D/D/D/D/D/D/XXX&apos;
  Size: 0               Blocks: 0          IO Block: 4096   regular empty file
Device: 700h/1792d      Inode: 111         Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2013-02-26 21:37:51.000000000 -0600
Modify: 2013-02-26 21:37:51.000000000 -0600
Change: 2013-02-26 21:37:51.000000000 -0600
# find /mnt/mds1/ROOT
/mnt/mds1/ROOT
/mnt/mds1/ROOT/.lustre
/mnt/mds1/ROOT/D
# sys_getdents --verbose /mnt/mds1/ROOT
d_type =   4 (d), d_ino =                  2, d_off =  2085404527983360875, d_reclen =   24, d_name = &apos;..&apos;
d_type =   4 (d), d_ino =              50013, d_off =  3188331865672730665, d_reclen =   24, d_name = &apos;.&apos;
dirent &apos;.lustre&apos; has unknown d_type 20
d_type =  20 (!), d_ino =              50014, d_off =  8374721202256512604, d_reclen =   32, d_name = &apos;.lustre&apos;
dirent &apos;D&apos; has unknown d_type 20
d_type =  20 (!), d_ino =              50015, d_off =  9223372036854775807, d_reclen =   24, d_name = &apos;D&apos;
#
# sys_getdents --verbose /mnt/mds1/ROOT/D/D/D/D/D/D/
dirent &apos;..&apos; has unknown d_type 20
d_type =  20 (!), d_ino =              50019, d_off =  2085404527983360875, d_reclen =   24, d_name = &apos;..&apos;
d_type =   4 (d), d_ino =              50020, d_off =  6678178485617948048, d_reclen =   24, d_name = &apos;.&apos;
dirent &apos;XXX&apos; has unknown d_type 24
d_type =  24 (!), d_ino =                111, d_off =  9223372036854775807, d_reclen =   24, d_name = &apos;XXX&apos;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</description>
                <environment></environment>
        <key id="17719">LU-2880</key>
            <summary>ldiskfs getdents() returns invalid d_types </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="1">Fixed</resolution>
                                        <assignee username="bogl">Bob Glossman</assignee>
                                    <reporter username="jhammond">John Hammond</reporter>
                        <labels>
                            <label>patch</label>
                    </labels>
                <created>Tue, 26 Feb 2013 23:21:23 +0000</created>
                <updated>Thu, 14 Aug 2014 16:55:55 +0000</updated>
                            <resolved>Mon, 2 Jun 2014 15:46:56 +0000</resolved>
                                    <version>Lustre 2.4.0</version>
                                    <fixVersion>Lustre 2.6.0</fixVersion>
                                        <due></due>
                            <votes>0</votes>
                                    <watches>11</watches>
                                                                            <comments>
                            <comment id="58000" author="manisha" created="Thu, 9 May 2013 08:52:40 +0000"  >&lt;p&gt;ldiskfs just does not return the file type bits but also the dirdata info bits (get_dtype()).&lt;br/&gt;
The osd-ldiskfs layer calls ldiskfs internally and it needs this dirdata bit information.&lt;br/&gt;
From osd-ldiskfs  call_filldir() (its used for htree indexing directories) calls get_dtype().&lt;br/&gt;
So simply masking the dirdata bits would break the osd-ldiskfs functionality.&lt;/p&gt;

&lt;p&gt;Other way to fix the issue could be , provide a mount option &quot;nodirdata&quot; for mounting ldiskfs. If this option is set we will not return dirdata bits information.&lt;/p&gt;</comment>
                            <comment id="59034" author="adilger" created="Wed, 22 May 2013 06:46:26 +0000"  >&lt;p&gt;It makes more sense to add a mount option to &lt;em&gt;enable&lt;/em&gt; the dirdata options in the ext4_data_in_dirent, and then set this mount option to osd_ldiskfs/osd_handler.c::osd_mount().  This will make the dirdata only available for Lustre, and will not require non-Lustre mounts to specify an option in order to work properly.&lt;/p&gt;

&lt;p&gt;Instead of passing a text mount option in osd_mount() (which adds complexity and is prone to errors if ldiskfs is packaged separately and wasn&apos;t patched for this option) it is also possible to set this option directly in the superblock:&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; #define EXT4_MOUNT_ERRORS_MASK          0x00070
 #define EXT4_MOUNT_MINIX_DF             0x00080 &lt;span class=&quot;code-comment&quot;&gt;/* Mimics the Minix statfs */&lt;/span&gt;
 #define EXT4_MOUNT_NOLOAD               0x00100 &lt;span class=&quot;code-comment&quot;&gt;/* Don&apos;t use existing journal*/&lt;/span&gt;
+#define EXT4_MOUNT_DIRDATA              0x00200 &lt;span class=&quot;code-comment&quot;&gt;/* Data in directory entries */&lt;/span&gt;
 #define EXT4_MOUNT_DATA_FLAGS           0x00C00 &lt;span class=&quot;code-comment&quot;&gt;/* Mode &lt;span class=&quot;code-keyword&quot;&gt;for&lt;/span&gt; data writes: */&lt;/span&gt;
 #define EXT4_MOUNT_JOURNAL_DATA         0x00400 &lt;span class=&quot;code-comment&quot;&gt;/* Write data to journal */&lt;/span&gt;
 #define EXT4_MOUNT_ORDERED_DATA         0x00800 &lt;span class=&quot;code-comment&quot;&gt;/* Flush data before commit */&lt;/span&gt;

 &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_mount(...)
 {
         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (lmd_flags &amp;amp; LMD_FLG_NOSCRUB)
                 o-&amp;gt;od_noscrub = 1;
 
+#ifdef EXT4_MOUNT_OPT_DIRDATA
+        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_DIRDATA))
+                set_opt(o-&amp;gt;od_mnt-&amp;gt;mnt_sb, DIRDATA);
+#endif
 out:
         &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (__page)
                 OBD_PAGE_FREE(__page);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This value for EXT4_MOUNT_DIRDATA appears to be unused for all of the relevant kernels.  In &lt;tt&gt;get_dtype()&lt;/tt&gt; it can just check for this mount option instead of checking the feature flag each time:&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; (!test_opt(sb, DIRDATA))
               &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; ext4_filetype_table[fl_index];

       &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; (ext4_filetype_table[fl_index]) |
               (filetype &amp;amp; EXT4_DIRENT_LUFID);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;</comment>
                            <comment id="59611" author="manisha" created="Thu, 30 May 2013 07:16:07 +0000"  >&lt;p&gt;Thanks Andreas, I have raised the code review request for it: &lt;br/&gt;
&lt;a href=&quot;http://review.whamcloud.com/#change,6495&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/#change,6495&lt;/a&gt;&lt;br/&gt;
Similar changes need to be done for sles11sp2.&lt;/p&gt;</comment>
                            <comment id="62688" author="simmonsja" created="Mon, 22 Jul 2013 14:30:50 +0000"  >&lt;p&gt;We ran into this with our purge utility. Do you mind if I update the patch and try it out on our SuSE boxes.&lt;/p&gt;</comment>
                            <comment id="62789" author="manisha" created="Tue, 23 Jul 2013 11:21:21 +0000"  >&lt;p&gt;Sure.&lt;/p&gt;</comment>
                            <comment id="66357" author="bobbielind" created="Wed, 11 Sep 2013 15:51:11 +0000"  >&lt;p&gt;Patch &lt;a href=&quot;http://review.whamcloud.com/#/c/6411/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/#/c/6411/&lt;/a&gt; is related to this ticket.  &lt;/p&gt;</comment>
                            <comment id="67518" author="pjones" created="Wed, 25 Sep 2013 12:38:49 +0000"  >&lt;p&gt;Bob will take over this one&lt;/p&gt;</comment>
                            <comment id="85459" author="jlevi" created="Mon, 2 Jun 2014 15:46:56 +0000"  >&lt;p&gt;Patch landed to Master. &lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="17720">LU-2881</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|hzvjyf:</customfieldvalue>

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