When running LTP stress tests on ext4, after a multiday run we seemed to have hit the following BUG_ON: [NIP : start_this_handle+268] #3 [c000001067c27a40] start_this_handle at c008000004d40f74 [jbd2] (unreliable) #4 [c000001067c27b60] jbd2__journal_start at c008000004d415cc [jbd2] #5 [c000001067c27be0] update_super_work at c0080000053f9758 [ext4] #6 [c000001067c27c70] process_one_work at c000000000188790 #7 [c000001067c27d20] worker_thread at c00000000018973c #8 [c000001067c27dc0] kthread at c000000000196c84 #9 [c000001067c27e10] ret_from_kernel_thread at c00000000000cd64 Which comes out to 382 repeat: 383 read_lock(&journal->j_state_lock); * 384 BUG_ON(journal->j_flags & JBD2_UNMOUNT); 385 if (is_journal_aborted(journal) || 386 (journal->j_errno != 0 && !(journal->j_flags & JBD2_ACK_ERR))) { 387 read_unlock(&journal->j_state_lock); Initially this seemed like it should never happen but upon crash analysis it seems like it could indeed be hit as described in patch 1/2. I would like to add that through the logs we only knew that: - ext4_journal_bmap -> ext4_map_blocks is failing with EFSCORRUPTED. - update_super_work had hit the BUG_ON I was not able to hit this bug again (without modifying the kernel to inject errors) but the above backtrace seems to be one possible paths where this BUG_ON can be hit. Rest of the analysis and fix is in patch 1/2. Patch 2 is just a small tweak that i found helpful while debugging. That being said, journalling is something I'm not very familiar with and there might be gaps in my understanding so thoughts and suggestions are welcome. Ojaswin Mujoo (2): ext4: only defer sb update on error if SB_ACTIVE ext4: Make sb update interval tunable fs/ext4/ext4.h | 9 +++++++++ fs/ext4/super.c | 17 +++++++++-------- fs/ext4/sysfs.c | 4 ++++ 3 files changed, 22 insertions(+), 8 deletions(-) -- 2.48.1