Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3373829pxj; Mon, 7 Jun 2021 09:05:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/us+68ct+WpL/JsyIphOPZnIK6yjlY0TMU2iCCyymUahpx2/y8gXiZPC91E/ctx+CbllR X-Received: by 2002:a50:ff15:: with SMTP id a21mr20683644edu.103.1623081914205; Mon, 07 Jun 2021 09:05:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623081914; cv=none; d=google.com; s=arc-20160816; b=GBenYPTAjVgXO6BkJsHT3LyPBzN/xg9FhNnMTf04ExlTtfm3BxN1mLO5zGNns80L0a llo3OCqTQoELA0h9HkMa/JJ2t3/UdhN7hUmeeSsNUw1CuhB6/GO8KChj2u3wNDb49Egh tJM5b8AreQHx/sCRZCws0ve6tjpnNVdpJsenHEJfjDkVnTBgSXjBQJaqXbCT4MO1LRBO 7ON+TfRaHD3FGcyV8arfFh4sG5z8mUsVmDgEhxmkY62TgVLksJrA+Tj73XxiSbf95fPi Z6f/vUIxEM1KfN9uhn8hU7VHqFxpoTh92bcrMOsq0qU0aLyUjha3IWnqR8nAKXpAH+Xq 8fVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:auto-submitted :content-transfer-encoding:message-id:date:subject:to:from :dkim-signature; bh=Ss/5Et+aXANKWe2jSnNJkJjFiGm9eQ063VjrfNeAieQ=; b=i6esQGN7YG6fZ1YFuX9hN9D/+9eNFULbA5faOuW7CAXmi3O2VeRrVRuvHGr1PM8gH3 SOCLbYjHLGtJWwCeO1+gpbRaNbk8sIV/k2n+W+8T0YSJMPxIWO+3QXJHO/RojJJB4ZWR 12T5fj3j6s/+tJULT1WxxX3dX88skY4A/+cDaMVXHrdAkGrZH4VQJCh7Ijx/78LDmet0 KXLmfaAcTTWhWU+BQpBtVspZdz1NefNG0/CVCc1YSkWXvwP+j8sWw5Uv6fyA3NTX+Ek4 PfOBoLgyac7LExkPkfgdjBm/Qe7dhys2qu10IsGIj7uvxKqnhiYq7Oha1IoRA28Snkoi +RXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=EtTCqLwv; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f13si12897996edy.493.2021.06.07.09.04.49; Mon, 07 Jun 2021 09:05:14 -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=@kernel.org header.s=k20201202 header.b=EtTCqLwv; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230254AbhFGQFt (ORCPT + 99 others); Mon, 7 Jun 2021 12:05:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:39284 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230220AbhFGQFs (ORCPT ); Mon, 7 Jun 2021 12:05:48 -0400 Received: by mail.kernel.org (Postfix) with ESMTPS id A7BE2611AD for ; Mon, 7 Jun 2021 16:03:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623081837; bh=Lnq/kheCP0MOiN9u+G6HIyCpLMohbJI5gXFT26w8Dy4=; h=From:To:Subject:Date:From; b=EtTCqLwvoadnEYtiK1TvHK9wcNzOJnQLsWwnEkM1QM97QPxqpEscDWCbl2rzmrfoN UrYzaNQU7Ni+xTT4suGKaUxEuueI2JhXguqIGsp6fLqO5rXY9qF7Hp3JUTBsHL7QCQ R6WhcxbbvTbnntnNiIRDRLJ5j7qXkgOKV3jDuPkJhA9CyBRnwVvvmUXSiv6nD5GjTR ONprwfX4Kvpu+VnrcAe3pUzktBKb+SfCcfV/FIQNyIXw/AEZjGwOm+nu570m1wLHQ6 LwykYPC8kBJ6uwzxzL9ViYn12+oJmWBi7xHFKJlnsE2GGyPa2bGD/JJfvcBXHuTXjP AD3QHZufTOJ6w== Received: by pdx-korg-bugzilla-2.web.codeaurora.org (Postfix, from userid 48) id 9CE4461175; Mon, 7 Jun 2021 16:03:57 +0000 (UTC) From: bugzilla-daemon@bugzilla.kernel.org To: linux-ext4@vger.kernel.org Subject: [Bug 213357] New: chattr +e writes invalid checksum to extent block Date: Mon, 07 Jun 2021 16:03:57 +0000 X-Bugzilla-Reason: None X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: AssignedTo fs_ext4@kernel-bugs.osdl.org X-Bugzilla-Product: File System X-Bugzilla-Component: ext4 X-Bugzilla-Version: 2.5 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jeroen@wolffelaar.nl X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: fs_ext4@kernel-bugs.osdl.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version cf_kernel_version rep_platform op_sys cf_tree bug_status bug_severity priority component assigned_to reporter cf_regression attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugzilla.kernel.org/ Auto-Submitted: auto-generated MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org https://bugzilla.kernel.org/show_bug.cgi?id=3D213357 Bug ID: 213357 Summary: chattr +e writes invalid checksum to extent block Product: File System Version: 2.5 Kernel Version: 5.13.0-rc4 Hardware: All OS: Linux Tree: Mainline Status: NEW Severity: normal Priority: P1 Component: ext4 Assignee: fs_ext4@kernel-bugs.osdl.org Reporter: jeroen@wolffelaar.nl Regression: No Created attachment 297207 --> https://bugzilla.kernel.org/attachment.cgi?id=3D297207&action=3Dedit Reproduction script Overview: Converting a file previously using (ext2/3) blocklists to ext4 extents using chattr +e makes the kernel write an invalid checksum to the extent block (if one needs to be written because of the metadata_csum feature & there being = more than 4 extents). Because of inode caching, this won't be obvious until the inode has has been evicted from the cache, or the filesystem is remounted. = The checksum errors are trivially correctable using e2fsck. Reproduction: In short: * Create a large enough file on an ext3 filesystem to have it 5+ discontinu= ous ranges of blocks * Add 'extent' and 'metadata_csum' feature to the filesystem * chattr +e the file * Reload the filesystem/clear inode cache See repro.sh for full steps. Observe: * Reading the file gives I/O errors (EXT4-fs error: ext4_find_extent:885: i= node #12: comm cat: pblk 17591 bad header/extent: extent tree corrupted - magic f30a, entries 6, max 340(340), depth 0(0)) * e2fsck reports checksum mismatch (ext2fs_block_iterate3: Extent block checksum does not match extent block) Reproduction: Besides the system where I originally found the bug, I reproduced it with 3 Debian versions (Stretch, Buster, Bullseye rc1), and additionally Bullseye = with vanilla 5.13.0-rc4 kernel built from kernel.org source tarball: so, kernel versions spanning 4.9 to 5.13. The reproduction script is destructive to the provided device. --=20 You may reply to this email to add a comment. You are receiving this mail because: You are watching the assignee of the bug.=