<!-- 
RSS generated by JIRA (9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c) at Sat Feb 10 01:54:13 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-5753] fix tid wraparound problem for rhel5</title>
                <link>https://jira.whamcloud.com/browse/LU-5753</link>
                <project id="10000" key="LU">Lustre</project>
                    <description>&lt;p&gt;Under RHEL5,  we hit a kernel bug like following:&lt;/p&gt;

&lt;p&gt;kernel BUG at fs/jbd2/commit.c:395&lt;br/&gt;
invalid opcode: 0000 &lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt; SMP &lt;br/&gt;
last sysfs file: /devices/pci0000:00/0000:00:09.0/0000:04:00.0/host2/target2:0:0/2:0:0:27/timeout&lt;br/&gt;
CPU 9 &lt;br/&gt;
Modules linked in: obdfilter(U) fsfilt_ldiskfs(U) exportfs ost(U) mgc(U) ldiskfs(U) jbd2 crc16 lustre(U) lov(U) osc(U) lquota(U) mdc(U) fid(U) fld(U) ksocklnd(U) ko2iblnd(U) ptlrpc(U) obdclass(U) lnet(U) lvfs(U) libcfs(U) nfs nfs_acl sg autofs4 ib_srp(U) lockd sunrpc rdma_ucm(U) ib_ucm(U) rdma_cm(U) iw_cm(U) ib_addr(U) ib_ipoib(U) ipoib_helper(U) ib_cm(U) ib_sa(U) ipv6 xfrm_nalgo crypto_api ib_uverbs(U) ib_umad(U) iw_nes(U) mlx4_ib(U) ib_mthca(U) ib_mad(U) ib_core(U) loop dm_mirror dm_round_robin dm_multipath scsi_dh video backlight sbs power_meter hwmon i2c_ec i2c_core dell_wmi wmi button battery asus_acpi acpi_memhotplug ac parport_pc lp parport mlx4_en(U) mlx4_core(U) i7core_edac tpm_tis bnx2 hpilo tpm edac_mc tpm_bios serio_raw pcspkr dm_raid45 dm_message dm_region_hash dm_log dm_mod dm_mem_cache shpchp cciss sd_mod scsi_mod ext3 jbd uhci_hcd ohci_hcd ehci_hcd&lt;br/&gt;
Pid: 13516, comm: jbd2/dm-14-8 Tainted: G -------------------- 2.6.18-348.6.1.el5_lustre #1&lt;br/&gt;
RIP: 0010:&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;lt;ffffffff88cadf98&amp;gt;&amp;#93;&lt;/span&gt; &lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;lt;ffffffff88cadf98&amp;gt;&amp;#93;&lt;/span&gt; :jbd2:jbd2_journal_commit_transaction+0x50/0x1120&lt;br/&gt;
RSP: 0018:ffff810289fcbd70 EFLAGS: 00010246&lt;br/&gt;
RAX: 0000000000000008 RBX: ffff8105d7611800 RCX: 0000000000000246&lt;br/&gt;
RDX: 0000000000000008 RSI: 0000000000000286 RDI: 0000000000000000&lt;br/&gt;
RBP: ffff8105d7611800 R08: ffff8105d7611898 R09: 0000000000000001&lt;br/&gt;
R10: 0000000000000000 R11: 0000000000000280 R12: ffff8105d7611824&lt;br/&gt;
R13: ffff8105d76118c0 R14: 0000000000000000 R15: ffff8105d7611890&lt;br/&gt;
FS: 0000000000000000(0000) GS:ffff81061fe5dc40(0000) knlGS:0000000000000000&lt;br/&gt;
CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b&lt;br/&gt;
CR2: 000000000928d2c8 CR3: 000000061db55000 CR4: 00000000000006a0&lt;br/&gt;
Process jbd2/dm-14-8 (pid: 13516, threadinfo ffff810289fca000, task ffff8105ec0f27f0)&lt;br/&gt;
Stack: ffff8105e4eb6000 00000fdcec0f2828 0000000800000000 00000001ffffffff&lt;br/&gt;
0000000000000001 0000000084552f72 0000000000000000 00000000000000e4&lt;br/&gt;
0000000000000000 0000000000000000 0000000000000000 0000000000000001&lt;br/&gt;
Call Trace:&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;lt;ffffffff8003dddd&amp;gt;&amp;#93;&lt;/span&gt; lock_timer_base+0x1b/0x3c&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;lt;ffffffff8004b384&amp;gt;&amp;#93;&lt;/span&gt; try_to_del_timer_sync+0x7f/0x88&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;lt;ffffffff88cb223e&amp;gt;&amp;#93;&lt;/span&gt; :jbd2:kjournald2+0x9a/0x1ec&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;lt;ffffffff800a3cdf&amp;gt;&amp;#93;&lt;/span&gt; autoremove_wake_function+0x0/0x2e&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;lt;ffffffff88cb21a4&amp;gt;&amp;#93;&lt;/span&gt; :jbd2:kjournald2+0x0/0x1ec&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;lt;ffffffff800a3ac7&amp;gt;&amp;#93;&lt;/span&gt; keventd_create_kthread+0x0/0xc4&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;lt;ffffffff80032c4f&amp;gt;&amp;#93;&lt;/span&gt; kthread+0xfe/0x132&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;lt;ffffffff8005dfc1&amp;gt;&amp;#93;&lt;/span&gt; child_rip+0xa/0x11&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;lt;ffffffff800a3ac7&amp;gt;&amp;#93;&lt;/span&gt; keventd_create_kthread+0x0/0xc4&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;lt;ffffffff80032b51&amp;gt;&amp;#93;&lt;/span&gt; kthread+0x0/0x132&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;&amp;lt;ffffffff8005dfb7&amp;gt;&amp;#93;&lt;/span&gt; child_rip+0x0/0x11 &lt;/p&gt;
{no format}

&lt;p&gt;it could be reproduced by following steps will make rhel5 kernel crash.&lt;br/&gt;
Generating a big enough sequence id.&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;root@localhost ~&amp;#93;&lt;/span&gt;# dumpe2fs sequence_image1 | grep sequence&lt;br/&gt;
dumpe2fs 1.42.9.wc1 (24-Feb-2014)&lt;br/&gt;
Journal sequence:         0xb2a5df5c&lt;/p&gt;

&lt;p&gt;Then running following program under Ext4 filesystem:&lt;br/&gt;
&lt;span class=&quot;error&quot;&gt;&amp;#91;root@promote mnt&amp;#93;&lt;/span&gt;# cat test_fsync.c &lt;br/&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br/&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br/&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br/&gt;
#include &amp;lt;sys/types.h&amp;gt;&lt;br/&gt;
#include &amp;lt;sys/stat.h&amp;gt;&lt;br/&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;/p&gt;

&lt;p&gt;int main(int argc, char **argv)&lt;br/&gt;
{&lt;/p&gt;

&lt;p&gt;    int ret;&lt;/p&gt;

&lt;p&gt;    int fd = open(argv&lt;span class=&quot;error&quot;&gt;&amp;#91;1&amp;#93;&lt;/span&gt;, O_RDWR | O_CREAT);&lt;br/&gt;
    if (fd &amp;lt; 0)&lt;br/&gt;
        return 1;&lt;/p&gt;

&lt;p&gt;    ret = fdatasync(fd);&lt;br/&gt;
    if (ret &amp;lt; 0) &lt;/p&gt;
{
        printf(&quot;we failed here?\n&quot;);
        goto failed;
    }
&lt;p&gt;failed:&lt;br/&gt;
    close(fd);&lt;br/&gt;
    return 0;&lt;br/&gt;
}&lt;/p&gt;

&lt;ol&gt;
	&lt;li&gt;gcc test_fsync.c&lt;br/&gt;
#./a.out new_file     ----&amp;gt;kernel will crash&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Since @i_sync_tid and @i_datasync_tid is not properly assigned, it is initialized to zero.&lt;br/&gt;
these value is passed into ext4_sync_file().&lt;/p&gt;

&lt;p&gt;the problem is 0 is a special value, tid_geq() will think 0 is a later commit..this will cause problems here.&lt;/p&gt;

&lt;p&gt;This problem did not exist for rhel6, we need backport this patch for Lustre rhel5 series.&lt;/p&gt;

&lt;p&gt;I confirm following patch could fix the problem:&lt;br/&gt;
commit 688f869ce3bdc892daa993534dc6df18c95df931&lt;br/&gt;
Author: Theodore Ts&apos;o &amp;lt;tytso@mit.edu&amp;gt;&lt;br/&gt;
Date:   Wed Mar 16 17:16:31 2011 -0400&lt;/p&gt;

&lt;p&gt;    ext4: Initialize fsync transaction ids in ext4_new_inode()&lt;/p&gt;

&lt;p&gt;    When allocating a new inode, we need to make sure i_sync_tid and&lt;br/&gt;
    i_datasync_tid are initialized.  Otherwise, one or both of these two&lt;br/&gt;
    values could be left initialized to zero, which could potentially&lt;br/&gt;
    result in BUG_ON in jbd2_journal_commit_transaction.&lt;/p&gt;

&lt;p&gt;    (This could happen by having journal-&amp;gt;commit_request getting set to&lt;br/&gt;
    zero, which could wake up the kjournald process even though there is&lt;br/&gt;
    no running transaction, which then causes a BUG_ON via the&lt;br/&gt;
    J_ASSERT(j_ruinning_transaction != NULL) statement.&lt;/p&gt;

&lt;p&gt;    Signed-off-by: &quot;Theodore Ts&apos;o&quot; &amp;lt;tytso@mit.edu&amp;gt;&lt;/p&gt;

&lt;p&gt;diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c&lt;br/&gt;
index 2fd3b0e..a679a48 100644&lt;br/&gt;
&amp;#8212; a/fs/ext4/ialloc.c&lt;br/&gt;
+++ b/fs/ext4/ialloc.c&lt;br/&gt;
@@ -1054,6 +1054,11 @@ got:&lt;br/&gt;
                }&lt;br/&gt;
        }&lt;/p&gt;

&lt;p&gt;+       if (ext4_handle_valid(handle)) &lt;/p&gt;
{
+               ei-&amp;gt;i_sync_tid = handle-&amp;gt;h_transaction-&amp;gt;t_tid;
+               ei-&amp;gt;i_datasync_tid = handle-&amp;gt;h_transaction-&amp;gt;t_tid;
+       }
&lt;p&gt;+&lt;br/&gt;
        err = ext4_mark_inode_dirty(handle, inode);&lt;br/&gt;
        if (err) {&lt;br/&gt;
                ext4_std_error(sb, err);&lt;/p&gt;</description>
                <environment>RHEL5 kernel</environment>
        <key id="27044">LU-5753</key>
            <summary>fix tid wraparound problem for rhel5</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="2">Won&apos;t Fix</resolution>
                                        <assignee username="ys">Yang Sheng</assignee>
                                    <reporter username="wangshilong">Wang Shilong</reporter>
                        <labels>
                            <label>mn1</label>
                            <label>patch</label>
                    </labels>
                <created>Thu, 16 Oct 2014 11:59:41 +0000</created>
                <updated>Tue, 13 Oct 2015 01:39:24 +0000</updated>
                            <resolved>Tue, 13 Oct 2015 01:39:24 +0000</resolved>
                                    <version>Lustre 2.1.6</version>
                                                        <due></due>
                            <votes>0</votes>
                                    <watches>4</watches>
                                                                            <comments>
                            <comment id="96468" author="wangshilong" created="Thu, 16 Oct 2014 12:11:39 +0000"  >&lt;p&gt;This is patch that i tried to fix this problem:&lt;br/&gt;
&lt;a href=&quot;http://review.whamcloud.com/#/c/12309/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://review.whamcloud.com/#/c/12309/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Best Regards,&lt;br/&gt;
Wang Shilong&lt;/p&gt;</comment>
                            <comment id="96478" author="pjones" created="Thu, 16 Oct 2014 14:14:23 +0000"  >&lt;p&gt;Yang Sheng&lt;/p&gt;

&lt;p&gt;Could you please review this patch?&lt;/p&gt;

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

&lt;p&gt;Peter&lt;/p&gt;</comment>
                            <comment id="120057" author="ys" created="Wed, 1 Jul 2015 16:08:45 +0000"  >&lt;p&gt;Do we still need rhel5 patch to land?&lt;/p&gt;</comment>
                            <comment id="120143" author="pjones" created="Thu, 2 Jul 2015 13:27:02 +0000"  >&lt;p&gt;Yang Sheng&lt;/p&gt;

&lt;p&gt;Not at present - we have no current plans to make a 2.1.7 release.&lt;/p&gt;

&lt;p&gt;Peter&lt;/p&gt;</comment>
                            <comment id="130162" author="jfc" created="Tue, 13 Oct 2015 01:39:24 +0000"  >&lt;p&gt;Resolving as &apos;Won&apos;t Fix&apos;&lt;br/&gt;
~ jfc.&lt;/p&gt;</comment>
                    </comments>
                    <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|hzwypb:</customfieldvalue>

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