Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp948104pxb; Thu, 19 Nov 2020 18:56:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2rUhybmxUAcujckEo5RTiXzi7XmRtQTMb7vlLsBOcepYs5BQE5ruzdDh9vAZGyLkOYPk4 X-Received: by 2002:a17:906:60c4:: with SMTP id f4mr31389684ejk.336.1605840963908; Thu, 19 Nov 2020 18:56:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605840963; cv=none; d=google.com; s=arc-20160816; b=lJpKD2mIF7h0QNounBaapwk7eEXvScm7LlQdNOpBVGou3L8Vrq7wo5UXMYc9q5z18r cj+DXLbHKEOSym1Ji8RYJ5JSsw9vFzvIprsLrKEimSF6z0a5NWJmAMG8TWkUON0W+OsG sgSPoKKSG+jAVURxfAEc6JuJ6bLK+qm3CY0FHSm2kQ06tyP6ZhLs+9Hsupmk2aRoKYvV Y708X646pzManLDGCmoNJqiCuzcANcYkZtDwCmHz1OsO7WGEAQ6/HASWCOd7GIrrlfWN OLyF5VHxDEb5PRnbcmduGz2ztkZEgPs/jZF6F4wycDT4koXo5TPoY15nToKWi5dRI95S orGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=nAWC0naUxOoieRNf+WOC0oFibjjBzKkxi9imrXqK9no=; b=lEbfdnhW1oAymcb/IlvZ6EPoiqIPxDSm8TqEkH0of7aDQVwmi2Ks6OmhcDHwhXiR10 rggql5Uv52Wish2UVJPNPmes9Ucs//erbQsxFCPzxCtVBfO9K3Rx0fa1F8mOt0SRPE1J 9GxpCXyIaGXWdTBy/TL8dUnA7uOw7QN6W5slNuNKNzlrOa8x0K/A2ZBMARdKVnsk7Nb6 7U9MWKcNR7BXgL02FTSY/Hb+eQbEC813AqO6zmI1aSZ3Lw6MYyxyWR6FhFulpNwtz3Ev s+wdUCvlvUqBocKHWdaounbAzqRAYy8hcAmMnSE6uCjNHXyej24WaQ21Lzwf5e7huZFP l11Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x3si1034712ejv.461.2020.11.19.18.55.35; Thu, 19 Nov 2020 18:56:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726281AbgKTCy1 (ORCPT + 99 others); Thu, 19 Nov 2020 21:54:27 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:8558 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725890AbgKTCy1 (ORCPT ); Thu, 19 Nov 2020 21:54:27 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Cch2b4lMLzLqBb; Fri, 20 Nov 2020 10:53:59 +0800 (CST) Received: from [10.174.179.106] (10.174.179.106) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.487.0; Fri, 20 Nov 2020 10:54:11 +0800 Subject: Re: [Bug report] journal data mode trigger panic in jbd2_journal_commit_transaction To: Mauricio Oliveira CC: "Theodore Y . Ts'o" , , Jan Kara , , "zhangyi (F)" , Hou Tao , , Ye Bin , References: <68b9650e-bef2-69e2-ab5e-8aaddaf46cfe@huawei.com> From: yangerkun Message-ID: <17d7ecde-5fda-cd03-6fef-e7b8250489f9@huawei.com> Date: Fri, 20 Nov 2020 10:54:10 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.106] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org 在 2020/11/19 21:12, Mauricio Oliveira 写道: > On Thu, Nov 19, 2020 at 1:25 AM yangerkun wrote: >> >> >> >> 在 2020/11/16 21:50, Mauricio Oliveira 写道: >>> Hi Kun, >>> >>> On Sat, Nov 14, 2020 at 5:18 AM yangerkun wrote: >>>> While using ext4 with data=journal(3.10 kernel), we meet a problem that >>>> we think may never happend... >>> [...] >>> >>> Could you please confirm you mean 5.10-rc* kernel instead of 3.10? >>> (It seems so as you mention a recent commit below.) Thanks! >>> >>>> For now, what I have seen that can dirty buffer directly is >>>> ext4_page_mkwrite(64a9f1449950 ("ext4: data=journal: fixes for >>>> ext4_page_mkwrite()")), and runing ext4_punch_hole with keep_size >>>> /ext4_page_mkwrite parallel can trigger above warning easily. >>> [...] >>> >>> >> >> Hi, >> >> Sorry for the long delay reply... And thanks a lot for your advise! The >> bug trigger with a very low probability. So won't trigger with 5.10 can >> not prove no bug exist in 5.10. >> > > No worries, and thanks for following up. > So I understand that the bug report was indeed on 3.10, and 5.10-rcN > is not yet confirmed. > >> Google a lot and notice that someone before has report the same bug[1]. >> '3b136499e906 ("ext4: fix data corruption in data=journal mode")' seems >> fix the problem. I will try to understand this, and give a analysis >> about how to reproduce it! > > Cool, thanks! > >> Thanks, >> Kun. > > > Hi, The follow step can reproduce the bug[1] reported before easily. And the bug we meet seems same. Following patch will fix the bug. 3b136499e906 ext4: fix data corruption in data=journal mode b90197b65518 ext4: use private version of page_zero_new_buffers() for data=journal mode 1. mkfs.ext4 2. touch $tofile(ino == 12) 3. touch $fromfile(ino == 13) and write 4k to fromfile and sync mmap $fromfile 4k and write 4k to $tofile ... generic_perform_write ext4_write_begin ext4_journal_start (trans 1) if (ino == 12) sleep for 30s ... truncate $fromfile to 0 copied=0,bytes=4k ext4_journalled_write_end page_zero_new_buffers mark_buffer_dirty write_end_fn ... __jbd2_journal_file_buffer test_clear_buffer_dirty __jbd2_journal_temp_unlink_buffer ext4_journal_stop (trans 1) trans1 commit ... ext4_truncate_failed_write ... journal_unmap_buffer set_buffer_freed forget list ... clear_buffer_jbddirty ... J_ASSERT_BH(bh, !buffer_dirty(bh)) ^^^^^^^^^^^^^^^^^ trigger the bug... [1]. https://www.spinics.net/lists/linux-ext4/msg56447.html Thanks, Kun.