<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 03:19:38 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-15591] ext2fs_open2() missing goto</title>
                <link>https://jira.whamcloud.com/browse/LU-15591</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;In e2fsprogs &lt;tt&gt;ext2fs_open2()&lt;/tt&gt; there is a missing &lt;tt&gt;goto cleanup&lt;/tt&gt; after &lt;tt&gt;retval = EXT2_ET_SB_CSUM_INVALID&lt;/tt&gt;. And probably after &lt;tt&gt;retval = EXT2_ET_UNKNOWN_CSUM;&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;
        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!(fs-&amp;gt;flags &amp;amp; EXT2_FLAG_IGNORE_CSUM_ERRORS)) {
                retval = 0;
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!ext2fs_verify_csum_type(fs, fs-&amp;gt;&lt;span class=&quot;code-keyword&quot;&gt;super&lt;/span&gt;))
                        retval = EXT2_ET_UNKNOWN_CSUM;
                &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (!ext2fs_superblock_csum_verify(fs, fs-&amp;gt;&lt;span class=&quot;code-keyword&quot;&gt;super&lt;/span&gt;)) {
                        &lt;span class=&quot;code-keyword&quot;&gt;if&lt;/span&gt; (csum_retries++ &amp;lt; 3)
                                &lt;span class=&quot;code-keyword&quot;&gt;goto&lt;/span&gt; retry;
                        retval = EXT2_ET_SB_CSUM_INVALID;
                }
        }
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Also I find it strange that we check the super block magic after verifying the checksum.&lt;/p&gt;</description>
                <environment></environment>
        <key id="68839">LU-15591</key>
            <summary>ext2fs_open2() missing goto</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="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="6">Not a Bug</resolution>
                                        <assignee username="wc-triage">WC Triage</assignee>
                                    <reporter username="jhammond">John Hammond</reporter>
                        <labels>
                    </labels>
                <created>Wed, 23 Feb 2022 22:21:56 +0000</created>
                <updated>Fri, 25 Feb 2022 00:36:21 +0000</updated>
                            <resolved>Fri, 25 Feb 2022 00:36:17 +0000</resolved>
                                                                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                            <comments>
                            <comment id="327319" author="adilger" created="Thu, 24 Feb 2022 20:24:33 +0000"  >&lt;p&gt;I was looking at the history of this code.  There used to be an &quot;&lt;tt&gt;if (retval) goto cleanup;&lt;/tt&gt;&quot; here, but it was moved:&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;commit f92c600c09bbda482c6c4a37602db4f0db864a9e
Author:     Darrick J. Wong &amp;lt;darrick.wong@oracle.com&amp;gt;
AuthorDate: Mon Sep 8 16:11:49 2014 -0700
Commit:     Theodore Ts&apos;o &amp;lt;tytso@mit.edu&amp;gt;
CommitDate: Thu Sep 11 12:40:54 2014 -0400

    libext2fs: report bad magic over bad sb checksum
    
    We don&apos;t want ext2fs_open2() to report bad sb checksum on something
    that&apos;s not even an ext* superblock.  This apparently happens pretty
    easily if we try to open an XFS filesystem.  Thus, make it so that a
    bad magic number code always trumps the sb checksum error code.
    
    Signed-off-by: Darrick J. Wong &amp;lt;darrick.wong@oracle.com&amp;gt;
    Signed-off-by: Theodore Ts&apos;o &amp;lt;tytso@mit.edu&amp;gt;

diff --git a/lib/ext2fs/openfs.c b/lib/ext2fs/openfs.c
index 00320f34..1d6f147c 100644
--- a/lib/ext2fs/openfs.c
+++ b/lib/ext2fs/openfs.c
@@ -221,8 +221,6 @@ errcode_t ext2fs_open2(const char *name, const char *io_opti
ons,
                        retval = EXT2_ET_UNKNOWN_CSUM;
                if (!ext2fs_superblock_csum_verify(fs, fs-&amp;gt;super))
                        retval = EXT2_ET_SB_CSUM_INVALID;
-               if (retval)
-                       goto cleanup;
        }
 
 #ifdef WORDS_BIGENDIAN
@@ -235,10 +233,11 @@ errcode_t ext2fs_open2(const char *name, const char *io_options,
        }
 #endif
 
-       if (fs-&amp;gt;super-&amp;gt;s_magic != EXT2_SUPER_MAGIC) {
+       if (fs-&amp;gt;super-&amp;gt;s_magic != EXT2_SUPER_MAGIC)
                retval = EXT2_ET_BAD_MAGIC;
+       if (retval)
                goto cleanup;
-       }
+
        if (fs-&amp;gt;super-&amp;gt;s_rev_level &amp;gt; EXT2_LIB_CURRENT_REV) {
                retval = EXT2_ET_REV_TOO_HIGH;
                goto cleanup;
&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;It isn&apos;t clear why the whole checksum validation block wasn&apos;t moved below the superblock magic number check.  It may be because the checksum needs to be computed on the un-swabbed/little-endian superblock, which happens immediately after the checksum validation?&lt;/p&gt;

&lt;p&gt;Is this actually a functional problem, or just an anomaly that you found while looking into this code?   Looking at the code it appears it will correctly handle a non-zero checksum &lt;tt&gt;retval&lt;/tt&gt; (i.e. it won&apos;t be overwritten by 0), just not immediately. I&apos;m just wondering if a fix is needed for this issue for proper &lt;tt&gt;O_DIRECT&lt;/tt&gt; usage, or if I should tag e2fsprogs-1.46.2.wc5 with only the &lt;a href=&quot;https://jira.whamcloud.com/browse/LU-15590&quot; title=&quot;e2fsprogs direct IO raw_read_blk() issues&quot; class=&quot;issue-link&quot; data-issue-key=&quot;LU-15590&quot;&gt;&lt;del&gt;LU-15590&lt;/del&gt;&lt;/a&gt; fix?&lt;/p&gt;</comment>
                            <comment id="327341" author="jhammond" created="Fri, 25 Feb 2022 00:36:09 +0000"  >&lt;p&gt;Maybe it&apos;s more confusing that a bug. Looking at the traces, it tried to read a good checksum three times then it returned EXT2_ET_BAD_MAGIC.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Related</name>
                                            <outwardlinks description="is related to ">
                                        <issuelink>
            <issuekey id="68838">LU-15590</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|i02j9j:</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>