Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1882152pxj; Sun, 9 May 2021 07:51:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzp35S0GFxiqHNXYstG8C8T4vK7BtWCiBL17qfRvGrIhKRJ1k+Wvp1LAjbrKzSTASeVoYx X-Received: by 2002:a17:906:79a:: with SMTP id l26mr21121350ejc.268.1620571894039; Sun, 09 May 2021 07:51:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620571894; cv=none; d=google.com; s=arc-20160816; b=XNCI9SP+RApVV09J1znehtWJ07+ru8zwfgqj9EtOPyGPgVXq6UtvU8hvO6mI70HJva yKEXHk0FL2B68fBpYGMLvKh6Zig/6BIBXBKDLTfQXfqp5zd4HCKUH28dy9yAzSkgjyqu lC9H9Jiqv03/Sm7Im213WmK/qvnj/NfAPpb0fdoXuMRfJJL2wsOh8a0eaZWwhzcAX7OP B1gs+oYi7w/53U/htn6x1sI1So+uIoz2XfokbehpvgpwJqxQT7OS80FnduqOBDvb6jK5 M8hyQ7AHLSuAOv2nS5E8V1nx3JHXxLb2yfb4jO+ApNNGPHjEOkihvid1SqCYIj47UJsZ 9EXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id :mime-version:in-reply-to:references:to:subject:from:date :dkim-signature; bh=DD6INhDAYtOvTP5v/+rsKZCm6Op/XIxo1DTgPoGYrgE=; b=FA+YujksDuBN8zyj+8zHTNXzJ4B3LnPCKO0SYHxkMFFIVxSA9dyQ1G2f6QRUxUWxX0 6SKfyFUW8FgHKBs/RMcKoz+EjAXAZHf6osX8AnWEdOmOczb+2hmLEyyo4syWN779V7ZY aq3+IpKaJfTR2CKg2gaRU1OiABBSZBabJzLt+QDfrLTZj3dIFVRH1hSeck7NZc7zC4nh Ox/MowltAbcLsIaOTAYGa7+JpvpYaJXSDwT1Iyinp4wEl2KL/RZ0tSGLEUpZspx71C2T m+koGpsB7AWZx5J/riRAvWDk5m+UH+BNqvehmElAK+Mg11KwMZ8MKjhi16OiOcKy8DPc ou0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yahoo.ca header.s=s2048 header.b=n+UKMaHQ; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=yahoo.ca Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v18si8182675ejc.691.2021.05.09.07.51.02; Sun, 09 May 2021 07:51:34 -0700 (PDT) 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; dkim=pass header.i=@yahoo.ca header.s=s2048 header.b=n+UKMaHQ; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=yahoo.ca Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229616AbhEIOsj (ORCPT + 99 others); Sun, 9 May 2021 10:48:39 -0400 Received: from sonic303-24.consmr.mail.gq1.yahoo.com ([98.137.64.205]:34194 "EHLO sonic303-24.consmr.mail.gq1.yahoo.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229631AbhEIOsg (ORCPT ); Sun, 9 May 2021 10:48:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.ca; s=s2048; t=1620571653; bh=DD6INhDAYtOvTP5v/+rsKZCm6Op/XIxo1DTgPoGYrgE=; h=Date:From:Subject:To:References:In-Reply-To:From:Subject:Reply-To; b=n+UKMaHQg8CfiniV8jyI0iVdktLykWjDi9tO+o7db08NQx4D9pr09OkFFuNt/11v6sbm4CL6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ukOo8W9INDDxXrArKQ.9SawMSlXr9JS8Sicd3FiNpkUiXCTb8Vw.qd_0pKujkpy1PGGUA. SpfF4d5GoAyoMYqqCABfXiSxH5y2LLmi0Qd6q4miMNS.Rm0hEl7yhX1Kt3cVtm9EMvrSoX0_t6Cv D9CCIuHRJn92G_gRl0rxMiK3LqyVj42ts7kO4C6bPt4WDRNNhPu9n_1nuoJoQCDywA4T7PBhiWD9 V7xWsX100KXBlZoWLVz9s2iQSgF4gSHfeO4UTdJIIwCYBpLWc1wBQVgKerC0VQHARf0y9SEG53GH Hb_FJ_x3V4Oh716DGdTXIRBElJ36mtPonLxMl1dJWONsXthIC7Qn.71QM.f.zS1jDwiQMHbrwRwm UMA207I.Dtkv8bKZPPrMuiVSMo.of0nOCWpVhV41.sbN4aG4glYj7AjvnnI1aCanSHCVm1S9eeKc b1uTf35PL.aFeJSd92UD9Jc9vI8usQtiL3LEFe6EG X-Sonic-MF: Received: from sonic.gate.mail.ne1.yahoo.com by sonic303.consmr.mail.gq1.yahoo.com with HTTP; Sun, 9 May 2021 14:47:33 +0000 Received: by kubenode508.mail-prod1.omega.ne1.yahoo.com (VZM Hermes SMTP Server) with ESMTPA ID 22743aee1a424fd368a0fbe95bdd2365; Sun, 09 May 2021 14:47:29 +0000 (UTC) Date: Sun, 09 May 2021 10:47:26 -0400 From: "Alex Xu (Hello71)" Subject: Re: regression: data corruption with ext4 on LUKS on nvme with torvalds master To: Jens Axboe , bgoncalv@redhat.com, bvanassche@acm.org, dm-crypt@saout.de, hch@lst.de, jaegeuk@kernel.org, linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, ming.lei@redhat.com, Changheun Lee , yi.zhang@redhat.com References: <1620493841.bxdq8r5haw.none@localhost> <1620526887.tg1zx7w5np.none@localhost> In-Reply-To: MIME-Version: 1.0 Message-Id: <1620571445.2k94orj8ee.none@localhost> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.18231 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Apache-HttpAsyncClient/4.1.4 (Java/16) Content-Length: 4163 Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Excerpts from Jens Axboe's message of May 8, 2021 11:51 pm: > On 5/8/21 8:29 PM, Alex Xu (Hello71) wrote: >> Excerpts from Alex Xu (Hello71)'s message of May 8, 2021 1:54 pm: >>> Hi all, >>> >>> Using torvalds master, I recently encountered data corruption on my ext= 4=20 >>> volume on LUKS on NVMe. Specifically, during heavy writes, the system=20 >>> partially hangs; SysRq-W shows that processes are blocked in the kernel= =20 >>> on I/O. After forcibly rebooting, chunks of files are replaced with=20 >>> other, unrelated data. I'm not sure exactly what the data is; some of i= t=20 >>> is unknown binary data, but in at least one case, a list of file paths=20 >>> was inserted into a file, indicating that the data is misdirected after= =20 >>> encryption. >>> >>> This issue appears to affect files receiving writes in the temporal=20 >>> vicinity of the hang, but affects both new and old data: for example, m= y=20 >>> shell history file was corrupted up to many months before. >>> >>> The drive reports no SMART issues. >>> >>> I believe this is a regression in the kernel related to something merge= d=20 >>> in the last few days, as it consistently occurs with my most recent=20 >>> kernel versions, but disappears when reverting to an older kernel. >>> >>> I haven't investigated further, such as by bisecting. I hope this is=20 >>> sufficient information to give someone a lead on the issue, and if it i= s=20 >>> a bug, nail it down before anybody else loses data. >>> >>> Regards, >>> Alex. >>> >>=20 >> I found the following test to reproduce a hang, which I guess may be the= =20 >> cause: >>=20 >> host$ cd /tmp >> host$ truncate -s 10G drive >> host$ qemu-system-x86_64 -drive format=3Draw,file=3Ddrive,if=3Dnone,id= =3Ddrive -device nvme,drive=3Ddrive,serial=3D1 [... more VM setup options] >> guest$ cryptsetup luksFormat /dev/nvme0n1 >> [accept warning, use any password] >> guest$ cryptsetup open /dev/nvme0n1 >> [enter password] >> guest$ mkfs.ext4 /dev/mapper/test >> [normal output...] >> Creating journal (16384 blocks): [hangs forever] >>=20 >> I bisected this issue to: >>=20 >> cd2c7545ae1beac3b6aae033c7f31193b3255946 is the first bad commit >> commit cd2c7545ae1beac3b6aae033c7f31193b3255946 >> Author: Changheun Lee >> Date: Mon May 3 18:52:03 2021 +0900 >>=20 >> bio: limit bio max size >>=20 >> I didn't try reverting this commit or further reducing the test case.=20 >> Let me know if you need my kernel config or other information. >=20 > If you have time, please do test with that reverted. I'd be anxious to > get this revert queued up for 5.13-rc1. >=20 > --=20 > Jens Axboe >=20 >=20 I tested reverting it on top of b741596468b010af2846b75f5e75a842ce344a6e=20 ("Merge tag 'riscv-for-linus-5.13-mw1' of=20 git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux"), causing it=20 to no longer hang. I didn't check if this fixes the data corruption, but=20 I assume so. I also tested a 1 GB image (works either way), and a virtio-blk=20 interface (works either way) The Show Blocked State from the VM (without revert): sysrq: Show Blocked State task:kworker/u2:0 state:D stack: 0 pid: 7 ppid: 2 flags:0x0000= 4000 Workqueue: kcryptd/252:0 kcryptd_crypt Call Trace: __schedule+0x1a2/0x4f0 schedule+0x63/0xe0 schedule_timeout+0x6a/0xd0 ? lock_timer_base+0x80/0x80 io_schedule_timeout+0x4c/0x70 mempool_alloc+0xfc/0x130 ? __wake_up_common_lock+0x90/0x90 kcryptd_crypt+0x291/0x4e0 process_one_work+0x1b1/0x300 worker_thread+0x48/0x3d0 ? process_one_work+0x300/0x300 kthread+0x129/0x150 ? __kthread_create_worker+0x100/0x100 ret_from_fork+0x22/0x30 task:mkfs.ext4 state:D stack: 0 pid: 979 ppid: 964 flags:0x0000= 4000 Call Trace: __schedule+0x1a2/0x4f0 ? __schedule+0x1aa/0x4f0 schedule+0x63/0xe0 schedule_timeout+0x99/0xd0 io_schedule_timeout+0x4c/0x70 wait_for_completion_io+0x74/0xc0 submit_bio_wait+0x46/0x60 blkdev_issue_zeroout+0x118/0x1f0 blkdev_fallocate+0x125/0x180 vfs_fallocate+0x126/0x2e0 __x64_sys_fallocate+0x37/0x60 do_syscall_64+0x61/0x80 ? do_syscall_64+0x6e/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae Regards, Alex.