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 [thread overview]
Message-ID: <bug-213357-13602@https.bugzilla.kernel.org/> (raw)
https://bugzilla.kernel.org/show_bug.cgi?id=213357
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=297207&action=edit
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+ discontinuous
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: inode
#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.
--
You may reply to this email to add a comment.
You are receiving this mail because:
You are watching the assignee of the bug.
next reply other threads:[~2021-06-07 16:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-07 16:03 bugzilla-daemon [this message]
2021-06-07 16:05 ` [Bug 213357] chattr +e writes invalid checksum to extent block bugzilla-daemon
2021-06-07 16:05 ` bugzilla-daemon
2021-12-09 12:30 ` bugzilla-daemon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-213357-13602@https.bugzilla.kernel.org/ \
--to=bugzilla-daemon@bugzilla.kernel.org \
--cc=linux-ext4@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).