Ye Bin
585ef03c9e
ext4: fix bug_on in start_this_handle during umount filesystem
...
[ Upstream commit b98535d091795a79336f520b0708457aacf55c67 ]
We got issue as follows:
------------[ cut here ]------------
kernel BUG at fs/jbd2/transaction.c:389!
invalid opcode: 0000 [#1 ] PREEMPT SMP KASAN PTI
CPU: 9 PID: 131 Comm: kworker/9:1 Not tainted 5.17.0-862.14.0.6.x86_64-00001-g23f87daf7d74-dirty #197
Workqueue: events flush_stashed_error_work
RIP: 0010:start_this_handle+0x41c/0x1160
RSP: 0018:ffff888106b47c20 EFLAGS: 00010202
RAX: ffffed10251b8400 RBX: ffff888128dc204c RCX: ffffffffb52972ac
RDX: 0000000000000200 RSI: 0000000000000004 RDI: ffff888128dc2050
RBP: 0000000000000039 R08: 0000000000000001 R09: ffffed10251b840a
R10: ffff888128dc204f R11: ffffed10251b8409 R12: ffff888116d78000
R13: 0000000000000000 R14: dffffc0000000000 R15: ffff888128dc2000
FS: 0000000000000000(0000) GS:ffff88839d680000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000001620068 CR3: 0000000376c0e000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
jbd2__journal_start+0x38a/0x790
jbd2_journal_start+0x19/0x20
flush_stashed_error_work+0x110/0x2b3
process_one_work+0x688/0x1080
worker_thread+0x8b/0xc50
kthread+0x26f/0x310
ret_from_fork+0x22/0x30
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
Above issue may happen as follows:
umount read procfs error_work
ext4_put_super
flush_work(&sbi->s_error_work);
ext4_mb_seq_groups_show
ext4_mb_load_buddy_gfp
ext4_mb_init_group
ext4_mb_init_cache
ext4_read_block_bitmap_nowait
ext4_validate_block_bitmap
ext4_error
ext4_handle_error
schedule_work(&EXT4_SB(sb)->s_error_work);
ext4_unregister_sysfs(sb);
jbd2_journal_destroy(sbi->s_journal);
journal_kill_thread
journal->j_flags |= JBD2_UNMOUNT;
flush_stashed_error_work
jbd2_journal_start
start_this_handle
BUG_ON(journal->j_flags & JBD2_UNMOUNT);
To solve this issue, we call 'ext4_unregister_sysfs() before flushing
s_error_work in ext4_put_super().
Signed-off-by: Ye Bin <yebin10@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Ritesh Harjani <riteshh@linux.ibm.com>
Link: https://lore.kernel.org/r/20220322012419.725457-1-yebin10@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-05-09 09:05:06 +02:00
..
2020-10-21 23:22:37 -04:00
2021-04-07 15:00:03 +02:00
2020-10-18 10:36:59 -04:00
2021-10-06 15:56:02 +02:00
2020-06-03 23:16:49 -04:00
2022-01-27 10:54:28 +01:00
2020-06-03 23:16:53 -04:00
2022-04-27 13:53:57 +02:00
2021-07-14 16:55:41 +02:00
2020-01-25 02:03:03 -05:00
2022-04-27 13:53:56 +02:00
2022-02-08 18:30:41 +01:00
2021-06-10 13:39:26 +02:00
2021-05-11 14:47:38 +02:00
2021-09-30 10:11:04 +02:00
2020-11-06 23:01:05 -05:00
2020-10-28 13:43:13 -04:00
2021-07-14 16:55:41 +02:00
2020-10-18 10:37:14 -04:00
2022-04-08 14:39:55 +02:00
2020-01-09 16:42:29 -07:00
2022-04-27 13:53:57 +02:00
2022-01-27 10:54:04 +01:00
2021-03-04 11:38:15 +01:00
2020-10-21 23:22:26 -04:00
2022-04-08 14:40:32 +02:00
2020-08-19 12:04:36 -04:00
2022-01-27 10:54:28 +01:00
2021-11-02 19:48:18 +01:00
2020-10-18 10:37:14 -04:00
2022-04-27 13:53:57 +02:00
2022-04-27 13:53:56 +02:00
2020-08-21 11:03:38 -07:00
2022-03-16 14:16:03 +01:00
2022-05-09 09:05:06 +02:00
2021-09-08 08:48:59 +02:00
2021-04-07 15:00:03 +02:00
2018-07-29 17:00:22 -04:00
2021-03-25 09:04:17 +01:00
2020-06-12 13:23:34 -04:00
2018-05-10 11:52:14 -04:00
2021-03-30 14:32:08 +02:00
2020-06-12 13:23:34 -04:00