<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:12:06 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-14710] check_dot() does not handle dirdata/FID entry properly</title>
                <link>https://jira.whamcloud.com/browse/LU-14710</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;In &lt;tt&gt;check_dot()&lt;/tt&gt; it assumes that the &quot;&lt;tt&gt;.&lt;/tt&gt;&quot; and &quot;&lt;tt&gt;..&lt;/tt&gt;&quot; entries are fixed at 12-bytes, but with the &lt;tt&gt;dirdata&lt;/tt&gt; feature storing a FID in these directory entries, they will be larger.  If there is some unrelated problem in the directory returned by &lt;tt&gt;e2fsck_check_dirent_data()&lt;/tt&gt; then this check will incorrectly cause the &quot;&lt;tt&gt;.&lt;/tt&gt;&quot; and &quot;&lt;tt&gt;..&lt;/tt&gt;&quot; entries to be recreated and clobber the FIDs.&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; &lt;span class=&quot;code-object&quot;&gt;int&lt;/span&gt; check_dot(...)
{
        :
        dir_data_error = e2fsck_check_dirent_data(ctx, dirent, offset, pctx);
        :
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (rec_len &amp;gt; 12) {
                new_len = rec_len - 12;
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (new_len &amp;gt; 12 &amp;amp;&amp;amp; dir_data_error) {
                        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (created ||
                            fix_problem(ctx, PR_2_SPLIT_DOT, pctx)) {
                                nextdir = (struct ext2_dir_entry *)
                                        ((&lt;span class=&quot;code-object&quot;&gt;char&lt;/span&gt; *) dirent + 12);
                                dirent-&amp;gt;rec_len = 12;
                                (void) ext2fs_set_rec_len(ctx-&amp;gt;fs, new_len,
                                                          nextdir);
                                nextdir-&amp;gt;inode = 0;
                                ext2fs_dirent_set_name_len(nextdir, 0);
                                ext2fs_dirent_set_file_type(nextdir,
                                                            EXT2_FT_UNKNOWN);
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;As a follow-on, the HTree index will no longer immediately follow the &quot;&lt;tt&gt;..&lt;/tt&gt;&quot; entry (&lt;tt&gt;fake_root&lt;/tt&gt;) and be invalidated:&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;Directory entry for &apos;.&apos; in ... (1032783) is big.
Split? no
Second entry &apos;3.3.0&apos; (inode=538027 fid=[0x380020941:0x4c38:0x0]) in directory inode 1032783 should be &apos;..&apos;
Fix? no
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The code in &lt;tt&gt;check_dot()&lt;/tt&gt; needs to be updated to properly check for the length of &lt;tt&gt;dirdata&lt;/tt&gt; entries.&lt;/p&gt;

&lt;p&gt;It doesn&apos;t look like same bug appears in &lt;tt&gt;check_dotdot()&lt;/tt&gt;.  It is checking for &lt;tt&gt;(rec_len &amp;lt; 12)&lt;/tt&gt;, which should be OK, since dirdata entries will always be larger.  Properly accounting for &lt;tt&gt;rec_len&lt;/tt&gt; in &lt;tt&gt;check_dot()&lt;/tt&gt; should avoid any problems in &lt;tt&gt;check_dotdot()&lt;/tt&gt;.  However, there is &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-7399&quot; title=&quot;e2fsck repair of &amp;quot;..&amp;quot; entries from LU-5626 should be improved&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-7399&quot;&gt;LU-7399&lt;/a&gt; which suggests an improvement for rebuilding &quot;&lt;tt&gt;..&lt;/tt&gt;&quot; in other situations.&lt;/p&gt;</description>
                <environment></environment>
        <key id="64410">LU-14710</key>
            <summary>check_dot() does not handle dirdata/FID entry properly</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="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>
                    </labels>
                <created>Wed, 26 May 2021 18:48:00 +0000</created>
                <updated>Mon, 14 Nov 2022 16:24:00 +0000</updated>
                                                                                <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                            <comments>
                            <comment id="302744" author="adilger" created="Thu, 27 May 2021 02:55:49 +0000"  >&lt;p&gt;In further investigation, it appears that &lt;tt&gt;check_dot()&lt;/tt&gt; &lt;b&gt;does&lt;/b&gt; do the right thing, in that the &quot;&lt;tt&gt;.&lt;/tt&gt;&quot; entry is created with &lt;tt&gt;rec_len=4096&lt;/tt&gt;, which &quot;hides&quot; the &quot;&lt;tt&gt;..&lt;/tt&gt;&quot; entry at offset 12 in the directory block.  This appears to be a bug introduced by &lt;tt&gt;osd-ldiskfs&lt;/tt&gt;, TBD.  &lt;tt&gt;check_dot()&lt;/tt&gt; goes on to repair the &quot;&lt;tt&gt;.&lt;/tt&gt;&quot; dirent to have &lt;tt&gt;rec_len=12&lt;/tt&gt;, and this &lt;em&gt;would&lt;/em&gt; allow the existing &quot;&lt;tt&gt;..&lt;/tt&gt;&quot; entry to be recovered, but it is instead clobbered.&lt;/p&gt;

&lt;p&gt;It would make sense to have &lt;tt&gt;check_dot()&lt;/tt&gt; do a quick sanity check and &quot;recover&quot; the &quot;&lt;tt&gt;..&lt;/tt&gt;&quot; entry if it looks reasonable (&lt;tt&gt;name=&quot;..&quot;&lt;/tt&gt;, &lt;tt&gt;namelen=2&lt;/tt&gt;, and &lt;tt&gt;rec_len &amp;lt; (blocksize-12)&lt;/tt&gt;, and then leave it up to &lt;tt&gt;check_dotdot()&lt;/tt&gt; to do the full sanity check, instead of unconditionally zeroing out the next entry.&lt;/p&gt;</comment>
                            <comment id="302931" author="gerrit" created="Fri, 28 May 2021 05:19:04 +0000"  >&lt;p&gt;Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/43858&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/43858&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-14710&quot; title=&quot;check_dot() does not handle dirdata/FID entry properly&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-14710&quot;&gt;LU-14710&lt;/a&gt; e2fsck: fix &quot;..&quot; more gracefully if possible&lt;br/&gt;
Project: tools/e2fsprogs&lt;br/&gt;
Branch: master-lustre&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: a5ace419651937b0f8c10b5cec5a8015f6780d28&lt;/p&gt;</comment>
                            <comment id="303128" author="gerrit" created="Mon, 31 May 2021 23:25:04 +0000"  >&lt;p&gt;Andreas Dilger (adilger@whamcloud.com) merged in patch &lt;a href=&quot;https://review.whamcloud.com/43858/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/43858/&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-14710&quot; title=&quot;check_dot() does not handle dirdata/FID entry properly&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-14710&quot;&gt;LU-14710&lt;/a&gt; e2fsck: fix &quot;..&quot; more gracefully if possible&lt;br/&gt;
Project: tools/e2fsprogs&lt;br/&gt;
Branch: master-lustre&lt;br/&gt;
Current Patch Set: &lt;br/&gt;
Commit: 5aa781e24b9ce22049c8542daaf47a05027a1179&lt;/p&gt;</comment>
                            <comment id="352931" author="adilger" created="Mon, 14 Nov 2022 16:24:00 +0000"  >&lt;p&gt;With &lt;tt&gt;dirdata&lt;/tt&gt; enabled, the &quot;&lt;tt&gt;..&lt;/tt&gt;&quot; entry may not be at offset 12, so it would be more graceful to do a quick scan to see if &quot;&lt;tt&gt;..&lt;/tt&gt;&quot; is at offset &quot;&lt;tt&gt;12+20=32&lt;/tt&gt;&quot; (1 byte NUL + 1 byte size + 16 byte lu_fid + alignment).  That wouldn&apos;t &quot;preserve&quot; the dirdata for &quot;&lt;tt&gt;.&lt;/tt&gt;&quot; but it might keep it for &quot;&lt;tt&gt;..&lt;/tt&gt;&quot;, which is more important anyway (for &lt;tt&gt;fid2path&lt;/tt&gt;).&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="33030">LU-7399</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="64446">LU-14719</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|i01vfb:</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>