From: Arthur Marsh <arthur.marsh@internode.on.net>
To: Theodore Ts'o <tytso@mit.edu>
Cc: Richard Weinberger <richard.weinberger@gmail.com>,
LKML <linux-kernel@vger.kernel.org>,
linux-ext4@vger.kernel.org
Subject: Re: ext3/ext4 filesystem corruption under post 5.1.0 kernels
Date: Wed, 15 May 2019 21:42:11 +0930 [thread overview]
Message-ID: <C24BBE18-1665-4343-9C98-5AF64BACDCA3@internode.on.net> (raw)
In-Reply-To: <20190515045717.GB5394@mit.edu>
[-- Attachment #1: Type: text/plain, Size: 2297 bytes --]
On 15 May 2019 2:27:17 pm ACST, Theodore Ts'o <tytso@mit.edu> wrote:
>Ah, I think I see the problem. Sorry, this one was my fault. Does
>this fix things for you?
>
> - Ted
>
>From 0c72924ef346d54e8627440e6d71257aa5b56105 Mon Sep 17 00:00:00 2001
>From: Theodore Ts'o <tytso@mit.edu>
>Date: Wed, 15 May 2019 00:51:19 -0400
>Subject: [PATCH] ext4: fix block validity checks for journal inodes
>using indirect blocks
>
>Commit 345c0dbf3a30 ("ext4: protect journal inode's blocks using
>block_validity") failed to add an exception for the journal inode in
>ext4_check_blockref(), which is the function used by ext4_get_branch()
>for indirect blocks. This caused attempts to read from the ext3-style
>journals to fail with:
>
>[ 848.968550] EXT4-fs error (device sdb7): ext4_get_branch:171: inode
>#8: block 30343695: comm jbd2/sdb7-8: invalid block
>
>Fix this by adding the missing exception check.
>
>Fixes: 345c0dbf3a30 ("ext4: protect journal inode's blocks using
>block_validity")
>Reported-by: Arthur Marsh <arthur.marsh@internode.on.net>
>Signed-off-by: Theodore Ts'o <tytso@mit.edu>
>---
> fs/ext4/block_validity.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
>diff --git a/fs/ext4/block_validity.c b/fs/ext4/block_validity.c
>index 8d03550aaae3..8e83741b02e0 100644
>--- a/fs/ext4/block_validity.c
>+++ b/fs/ext4/block_validity.c
>@@ -277,6 +277,11 @@ int ext4_check_blockref(const char *function,
>unsigned int line,
> __le32 *bref = p;
> unsigned int blk;
>
>+ if (ext4_has_feature_journal(inode->i_sb) &&
>+ (inode->i_ino ==
>+ le32_to_cpu(EXT4_SB(inode->i_sb)->s_es->s_journal_inum)))
>+ return 0;
>+
> while (bref < p+max) {
> blk = le32_to_cpu(*bref++);
> if (blk &&
I have built kernels with the attached patch applied and run git gc on the patched kernels (both the 32 bit kernel on the Pentium-D and the 64 bit kernel on the Athlon II X4 640).
There were a couple of warnings from other processes being blocked while the git gc was taking place but no filesystem corruption detected. (I ran forced fsck checks on the root filesystems after the git gc runs to check for corruption).
Thanks for the patch!
Arthur.
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
[-- Attachment #2: ext4.tmp --]
[-- Type: application/octet-stream, Size: 506 bytes --]
diff --git a/fs/ext4/block_validity.c b/fs/ext4/block_validity.c
index 968f163b5feb..66146a711871 100644
--- a/fs/ext4/block_validity.c
+++ b/fs/ext4/block_validity.c
@@ -276,6 +276,11 @@ int ext4_check_blockref(const char *function, unsigned int line,
__le32 *bref = p;
unsigned int blk;
+ if (ext4_has_feature_journal(inode->i_sb) &&
+ (inode->i_ino ==
+ le32_to_cpu(EXT4_SB(inode->i_sb)->s_es->s_journal_inum)))
+ return 0;
+
while (bref < p+max) {
blk = le32_to_cpu(*bref++);
if (blk &&
[-- Attachment #3: 20190515iucode_tool.log --]
[-- Type: application/octet-stream, Size: 4281 bytes --]
[ 1088.155025] INFO: task iucode_tool:9456 blocked for more than 120 seconds.
[ 1088.155032] Not tainted 5.1.0+ #3417
[ 1088.155033] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 1088.155035] iucode_tool D 0 9456 9453 0x00004000
[ 1088.155039] Call Trace:
[ 1088.155052] ? __schedule+0x297/0x690
[ 1088.155055] ? _raw_spin_lock_irqsave+0x22/0x50
[ 1088.155057] schedule+0x33/0xc0
[ 1088.155070] jbd2_log_wait_commit+0x9b/0x100 [jbd2]
[ 1088.155075] ? finish_wait+0xb0/0xb0
[ 1088.155110] ext4_sync_file+0x3eb/0x440 [ext4]
[ 1088.155115] do_fsync+0x43/0x80
[ 1088.155117] __x64_sys_fdatasync+0x13/0x20
[ 1088.155120] do_syscall_64+0x64/0x3d0
[ 1088.155123] ? __do_page_fault+0x288/0x590
[ 1088.155126] ? fpregs_assert_state_consistent+0x1e/0x50
[ 1088.155129] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 1088.155132] RIP: 0033:0x7f519f7a32c4
[ 1088.155139] Code: Bad RIP value.
[ 1088.155140] RSP: 002b:00007ffeb09a8848 EFLAGS: 00000246 ORIG_RAX: 000000000000004b
[ 1088.155142] RAX: ffffffffffffffda RBX: 000000000024d000 RCX: 00007f519f7a32c4
[ 1088.155144] RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000003
[ 1088.155145] RBP: 0000000000000003 R08: 000000000000014f R09: 000055a9e2d3b190
[ 1088.155146] R10: 0000000000000000 R11: 0000000000000246 R12: 000055a9e2d37870
[ 1088.155147] R13: 0000000000000150 R14: 000000000000006c R15: 0000000000000000
[ 1208.926585] INFO: task iucode_tool:9456 blocked for more than 241 seconds.
[ 1208.926589] Not tainted 5.1.0+ #3417
[ 1208.926590] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 1208.926592] iucode_tool D 0 9456 9453 0x00004000
[ 1208.926595] Call Trace:
[ 1208.926604] ? __schedule+0x297/0x690
[ 1208.926607] ? _raw_spin_lock_irqsave+0x22/0x50
[ 1208.926609] schedule+0x33/0xc0
[ 1208.926618] jbd2_log_wait_commit+0x9b/0x100 [jbd2]
[ 1208.926621] ? finish_wait+0xb0/0xb0
[ 1208.926643] ext4_sync_file+0x3eb/0x440 [ext4]
[ 1208.926647] do_fsync+0x43/0x80
[ 1208.926649] __x64_sys_fdatasync+0x13/0x20
[ 1208.926651] do_syscall_64+0x64/0x3d0
[ 1208.926654] ? __do_page_fault+0x288/0x590
[ 1208.926656] ? fpregs_assert_state_consistent+0x1e/0x50
[ 1208.926658] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 1208.926661] RIP: 0033:0x7f519f7a32c4
[ 1208.926666] Code: Bad RIP value.
[ 1208.926667] RSP: 002b:00007ffeb09a8848 EFLAGS: 00000246 ORIG_RAX: 000000000000004b
[ 1208.926669] RAX: ffffffffffffffda RBX: 000000000024d000 RCX: 00007f519f7a32c4
[ 1208.926670] RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000003
[ 1208.926671] RBP: 0000000000000003 R08: 000000000000014f R09: 000055a9e2d3b190
[ 1208.926672] R10: 0000000000000000 R11: 0000000000000246 R12: 000055a9e2d37870
[ 1208.926673] R13: 0000000000000150 R14: 000000000000006c R15: 0000000000000000
[ 1933.556182] INFO: task Thread (pooled):20910 blocked for more than 120 seconds.
[ 1933.556189] Not tainted 5.1.0+ #3417
[ 1933.556190] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 1933.556192] Thread (pooled) D 0 20910 1 0x00004000
[ 1933.556195] Call Trace:
[ 1933.556207] ? __schedule+0x297/0x690
[ 1933.556210] ? _raw_spin_lock_irqsave+0x22/0x50
[ 1933.556212] schedule+0x33/0xc0
[ 1933.556224] jbd2_log_wait_commit+0x9b/0x100 [jbd2]
[ 1933.556228] ? finish_wait+0xb0/0xb0
[ 1933.556261] ext4_sync_file+0x3eb/0x440 [ext4]
[ 1933.556266] do_fsync+0x43/0x80
[ 1933.556268] __x64_sys_fdatasync+0x13/0x20
[ 1933.556271] do_syscall_64+0x64/0x3d0
[ 1933.556274] ? __do_page_fault+0x288/0x590
[ 1933.556277] ? fpregs_assert_state_consistent+0x1e/0x50
[ 1933.556279] entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 1933.556282] RIP: 0033:0x7f90e22d62e7
[ 1933.556288] Code: Bad RIP value.
[ 1933.556290] RSP: 002b:00007f909d4e7a00 EFLAGS: 00000293 ORIG_RAX: 000000000000004b
[ 1933.556292] RAX: ffffffffffffffda RBX: 000000000000001a RCX: 00007f90e22d62e7
[ 1933.556293] RDX: 0000000000000000 RSI: 00007f909d4e79f0 RDI: 000000000000001a
[ 1933.556294] RBP: 00007f908c004bf0 R08: 000000000000401f R09: 00007f908c009940
[ 1933.556295] R10: 00007f908c009910 R11: 0000000000000293 R12: 0000000000000001
[ 1933.556296] R13: 0000000000000001 R14: 00007f909d4e7b50 R15: 0000000000000001
next prev parent reply other threads:[~2019-05-15 12:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-11 11:33 Arthur Marsh
2019-05-11 12:43 ` Richard Weinberger
2019-05-11 22:06 ` Theodore Ts'o
2019-05-13 7:45 ` Arthur Marsh
2019-05-13 10:31 ` Arthur Marsh
2019-05-14 1:59 ` Arthur Marsh
2019-05-14 10:42 ` Ondrej Zary
2019-05-15 2:59 ` Arthur Marsh
2019-05-15 4:57 ` Theodore Ts'o
2019-05-15 12:12 ` Arthur Marsh [this message]
2019-05-16 2:56 ` Theodore Ts'o
2019-05-17 16:44 ` Geert Uytterhoeven
2019-07-01 12:43 ` Geert Uytterhoeven
2019-07-01 13:56 ` Theodore Ts'o
2019-07-01 14:08 ` Geert Uytterhoeven
2019-05-17 9:23 ` Geert Uytterhoeven
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=C24BBE18-1665-4343-9C98-5AF64BACDCA3@internode.on.net \
--to=arthur.marsh@internode.on.net \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=richard.weinberger@gmail.com \
--cc=tytso@mit.edu \
/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
all inboxes | Powered by JetHome®