Linux EXT4 FS development
 help / color / mirror / Atom feed
* [PATCH 6.18.y 0/2] ext4: fix transaction overflow during writeback
@ 2026-11-25  0:22 Alireza Haghdoost
  2026-11-27 17:01 ` Sasha Levin
  0 siblings, 1 reply; 2+ messages in thread
From: Alireza Haghdoost @ 2026-11-25  0:22 UTC (permalink / raw)
  To: stable
  Cc: Greg Kroah-Hartman, Sasha Levin, Jan Kara, Theodore Ts'o,
	Zhang Yi, linux-ext4

Hi Greg, Sasha,

Please consider these two upstream commits (in v7.3-rc1) for 6.18.y:

  25b2a7e8d420 ("ext4: teach ext4_meta_trans_blocks() about number of
allocated extents")
  46e8e31771f4 ("ext4: fix transaction overflow during writeback")

46e8e31771f4 carries
  Fixes: 95ad8ee45cdb ("ext4: correct the reserved credits for extent
conversion")
and 95ad8ee45cdb went into v6.17-rc1, so 6.18.y is affected; 6.12.y and
older don't have it. 25b2a7e8d420 is its prerequisite. Both were queued
for 7.2.y (v7.2.6, as c391af5743a4 and a22464c5df58), but neither has
reached 6.18.y; I checked up to 6.18.65.

Why we are asking: since moving a fleet to 6.18, we have had
production panics on ext4 roots mounted with errors=panic (default
dioread_nolock, 4K blocks, x86-64). Three hosts went down within 14
minutes of each other, 47-57 hours after the upgrade. No I/O errors were
logged. The signature is:

  WARNING: CPU: 14 PID: 516083 at fs/jbd2/transaction.c:1562
jbd2_journal_dirty_metadata+0x211/0x220 [jbd2]
  WARNING: CPU: 14 PID: 516083 at fs/ext4/ext4_jbd2.c:368
__ext4_handle_dirty_metadata+0xe9/0x180 [ext4]
  EXT4-fs: ext4_convert_unwritten_extents_endio:3859: aborting
transaction: error 28 in __ext4_handle_dirty_metadata
  EXT4-fs error (device md127):
ext4_convert_unwritten_extents_endio:3859: inode #96132149: block
85533573:
    comm kworker/u194:0: journal_dirty_metadata failed: handle type 11
started at line 5070, credits 18/0, errcode -28
  Workqueue: ext4-rsv-conversion
  ext4_end_io_rsv_work -> ext4_end_io_end -> ext4_convert_unwritten_io_end_vec
    -> ext4_convert_unwritten_extents -> ext4_map_blocks -> ext4_ext_map_blocks
    -> __ext4_ext_dirty -> __ext4_handle_dirty_metadata ->
jbd2_journal_dirty_metadata

Line 5070 of fs/ext4/extents.c, the same in 6.18.65, is the
ext4_journal_start_reserved() call in ext4_convert_unwritten_io_end_vec().
The 18 requested credits are exactly the reserve that ext4_do_writepages()
computes after 95ad8ee45cdb, 1 + ext4_ext_index_trans_blocks(inode, 512)
= 1 + 15 + 2, for an inode whose mapping allows order-9 folios.
46e8e31771f4 replaces this with ext4_meta_trans_blocks(inode, bpf, bpf, 0).

The two backports follow as replies. 46e8e31771f4 applies cleanly.
25b2a7e8d420 needs two small adjustments, also noted in patch 1/2:

  - fs/ext4/ext4.h: the prototype hunk does not apply because of
    context differences;
  - fs/ext4/move_extent.c: 6.18 still calls ext4_meta_trans_blocks()
    from move_extent_per_page(), and that call no longer exists
    upstream. I pass block_len_in_page as the new alloc_extents
    argument, which keeps the current credit estimate there unchanged.

Testing: both patches apply to v6.18.65, and fs/ext4/ and fs/jbd2/
build with W=1 without warnings.

Thanks,
Alireza Haghdoost

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 6.18.y 0/2] ext4: fix transaction overflow during writeback
  2026-11-25  0:22 [PATCH 6.18.y 0/2] ext4: fix transaction overflow during writeback Alireza Haghdoost
@ 2026-11-27 17:01 ` Sasha Levin
  0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2026-11-27 17:01 UTC (permalink / raw)
  To: stable
  Cc: Sasha Levin, Greg Kroah-Hartman, Jan Kara, Theodore Ts'o,
	Zhang Yi, linux-ext4, Alireza Haghdoost

> The two backports follow as replies. 46e8e31771f4 applies cleanly.
> 25b2a7e8d420 needs two small adjustments, also noted in patch 1/2:

The two patches never reached the list, so I took both from mainline
for 6.18, with the same move_extent.c adjustment you describe
(block_len_in_page as the new alloc_extents argument).

Queued for 6.18, thanks.

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-27 17:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-25  0:22 [PATCH 6.18.y 0/2] ext4: fix transaction overflow during writeback Alireza Haghdoost
2026-11-27 17:01 ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox