<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 02:41:18 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-11142] test-framework.sh run_e2fsck masks return code</title>
                <link>https://jira.whamcloud.com/browse/LU-11142</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;&lt;tt&gt;run_e2fsck ... ... &quot;-n&quot;&lt;/tt&gt; does not return non-zero exit status if fs errors found.&lt;/p&gt;

&lt;p&gt;it makes fs consistency checks by run_e2fsck almost useless.&lt;/p&gt;

&lt;p&gt;I see e2fsck checks in many tests in sanity and conf-sanity scripts:&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;[zam@vm1 lustre-wc-rel]$ grep -e &quot;run_e2fsck.*-n&quot; lustre/tests/*.sh
lustre/tests/conf-sanity.sh: run_e2fsck $(facet_active_host $SINGLEMDS) $mdsdev &quot;-n&quot;
lustre/tests/conf-sanity.sh: run_e2fsck $mds1host $mds1dev &quot;-n&quot;
lustre/tests/sanity-lfsck.sh: run_e2fsck $(facet_active_host $SINGLEMDS) $(mdsdevname 1) &quot;-n&quot; |
lustre/tests/sanity-lfsck.sh: run_e2fsck $(facet_active_host $SINGLEMDS) $(mdsdevname 1) &quot;-n&quot;
lustre/tests/sanity.sh: run_e2fsck $(facet_active_host mds${mds_index}) $devname -n
lustre/tests/sanity.sh: run_e2fsck $(facet_active_host mds$mdt_index) $devname -n ||
lustre/tests/sanity.sh: run_e2fsck $(facet_active_host mds$idx) $dev -n ||
[zam@vm1 lustre-wc-rel]$
 &lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;br/&gt;
 for example test_804 in sanity.sh:&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;for&lt;/span&gt; idx in $(seq $MDSCOUNT); &lt;span class=&quot;code-keyword&quot;&gt;do&lt;/span&gt;
 dev=$(mdsdevname $idx)
 rc=0

stop mds${idx}
 run_e2fsck $(facet_active_host mds$idx) $dev -n ||
 rc=$?
 start mds${idx} $dev $MDS_MOUNT_OPTS ||
 error &lt;span class=&quot;code-quote&quot;&gt;&quot;mount mds$idx failed&quot;&lt;/span&gt;
 df $MOUNT &amp;gt; /dev/&lt;span class=&quot;code-keyword&quot;&gt;null&lt;/span&gt; 2&amp;gt;&amp;amp;1

# e2fsck should not &lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; error
 [ $rc -eq 0 ] ||
 error &lt;span class=&quot;code-quote&quot;&gt;&quot;e2fsck detected error on MDT${idx}: rc=$rc&quot;&lt;/span&gt;
 done

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;this code will never fails, because e2fsck exit code is lost in run_e2fsck function:&lt;/p&gt;

&lt;p&gt;another example is a test for&#160;&lt;a href=&quot;https://jira.whamcloud.com/browse/LU-2634&quot; title=&quot;short symlinks on MDT with &amp;quot;extents&amp;quot; have EXT4_EXTENTS_FL set&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-2634&quot;&gt;&lt;del&gt;LU-2634&lt;/del&gt;&lt;/a&gt;, it is about:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Short symlinks on MDT filesystems formatted with the &quot;extents&quot; feature appear to be created with the EXT4_EXTENTS_FL in osd-ldiskfs, but that shouldn&apos;t be happening. e2fsck considers this a corruption and deletes the symlink.&lt;/p&gt;&lt;/blockquote&gt;
&lt;p&gt;the test runs e2fsck at the end&#160;&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;
        #umount
        umount_client $MOUNT || error &lt;span class=&quot;code-quote&quot;&gt;&quot;umount client failed&quot;&lt;/span&gt;
        stop_mds || error &lt;span class=&quot;code-quote&quot;&gt;&quot;stop mds failed&quot;&lt;/span&gt;
        stop_ost || error &lt;span class=&quot;code-quote&quot;&gt;&quot;stop ost failed&quot;&lt;/span&gt;

        #run e2fsck
        run_e2fsck $(facet_active_host $SINGLEMDS) $mdsdev &lt;span class=&quot;code-quote&quot;&gt;&quot;-n&quot;&lt;/span&gt;
}
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;intention is to check the fs and fail the test if FS corrupted. there is no attempt to parse fsck output but only checking the exit code.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;however run_e2fsck coverts all exit codes below or equal 4 (FSCK_MAX_ERR) to 0:&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;
# Run e2fsck on MDT or OST device.
run_e2fsck() {
 local node=$1
 local target_dev=$2
 local extra_opts=$3
 local cmd=&lt;span class=&quot;code-quote&quot;&gt;&quot;$E2FSCK -d -v -t -t -f $extra_opts $target_dev&quot;&lt;/span&gt;
 local log=$TMP/e2fsck.log
 local rc=0

echo $cmd
 do_node $node $cmd 2&amp;gt;&amp;amp;1 | tee $log
 rc=${PIPESTATUS[0]}
 &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; [ -n &lt;span class=&quot;code-quote&quot;&gt;&quot;$(grep &quot;&lt;/span&gt;DNE mode isn&apos;t supported&lt;span class=&quot;code-quote&quot;&gt;&quot; $log)&quot;&lt;/span&gt; ]; then
 rm -f $log
 &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; [ $MDSCOUNT -gt 1 ]; then
 skip &lt;span class=&quot;code-quote&quot;&gt;&quot;DNE mode isn&apos;t supported!&quot;&lt;/span&gt;
 cleanupall
 exit_status
 &lt;span class=&quot;code-keyword&quot;&gt;else&lt;/span&gt;
 error &lt;span class=&quot;code-quote&quot;&gt;&quot;It&apos;s not DNE mode.&quot;&lt;/span&gt;
 fi
 fi
 rm -f $log

[ $rc -le $FSCK_MAX_ERR ] ||
 error &lt;span class=&quot;code-quote&quot;&gt;&quot;$cmd returned $rc, should be &amp;lt;= $FSCK_MAX_ERR&quot;&lt;/span&gt;

&lt;span class=&quot;code-keyword&quot;&gt;return&lt;/span&gt; 0
}

&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;It should be &lt;tt&gt;return $rc&lt;/tt&gt; at the end.&lt;/p&gt;



&lt;p&gt;FYI, e2fsck exit codes are:&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;        The exit code returned by e2fsck is the sum of the following conditions:
            0    - No errors
            1    - File system errors corrected
            2    - File system errors corrected, system should
                   be rebooted
            4    - File system errors left uncorrected
            8    - Operational error
            16   - Usage or syntax error
            32   - E2fsck canceled by user request
            128  - Shared library error&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;A workaround is to set FSCK_MAX_ERR to 0 before calling run_e2fsck , but nobody uses it in the tests. Or the variable is set globally in Maloo setup ...&#160; it means the default setting should be changed.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="52690">LU-11142</key>
            <summary>test-framework.sh run_e2fsck masks return code</summary>
                <type id="1" iconUrl="https://jira.whamcloud.com/secure/viewavatar?size=xsmall&amp;avatarId=11303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.whamcloud.com/images/icons/priorities/major.svg">Major</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="zam">Alexander Zarochentsev</assignee>
                                    <reporter username="zam">Alexander Zarochentsev</reporter>
                        <labels>
                            <label>patch</label>
                    </labels>
                <created>Wed, 11 Jul 2018 16:17:58 +0000</created>
                <updated>Fri, 21 Jan 2022 01:11:20 +0000</updated>
                                            <version>Upstream</version>
                    <version>Lustre 2.12.0</version>
                                                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                            <comments>
                            <comment id="230177" author="gerrit" created="Wed, 11 Jul 2018 16:26:08 +0000"  >&lt;p&gt;Alexander Zarochentsev (c17826@cray.com) uploaded a new patch: &lt;a href=&quot;https://review.whamcloud.com/32807&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/32807&lt;/a&gt;&lt;br/&gt;
Subject: &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11142&quot; title=&quot;test-framework.sh run_e2fsck masks return code&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11142&quot;&gt;LU-11142&lt;/a&gt; tests: run_e2fsck masks return code&lt;br/&gt;
Project: fs/lustre-release&lt;br/&gt;
Branch: master&lt;br/&gt;
Current Patch Set: 1&lt;br/&gt;
Commit: b9bae9d1c7375256214a7c791c97380ce4e90c37&lt;/p&gt;</comment>
                            <comment id="230187" author="zam" created="Wed, 11 Jul 2018 19:41:15 +0000"  >&lt;p&gt;I added&#160;&lt;a href=&quot;https://review.whamcloud.com/32807&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://review.whamcloud.com/32807&lt;/a&gt;&#160;patch to attempt to fix the problem and&#160; catch all&#160; regressions where run_e2fsck exit code is non-zero and should be ignored, there are at least two test cases e2fsck is used to move unconnected inodes to /lost+found .&lt;/p&gt;</comment>
                            <comment id="230476" author="zam" created="Wed, 18 Jul 2018 13:20:36 +0000"  >&lt;p&gt;I filed &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-11155&quot; title=&quot;hidden failures of sanity 804 test&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-11155&quot;&gt;LU-11155&lt;/a&gt; for sanity test 804 failures.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="52744">LU-11155</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="23211">LU-4651</issuekey>
        </issuelink>
                            </outwardlinks>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="53543">LU-11485</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|hzzz1z:</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>