Re: [PATCH v2] ext4: drop tmp inode ownership before migration cleanup

From: Theodore Ts'o

Date: Thu Nov 19 2026 - 09:51:23 EST



On Thu, 22 Oct 2026 15:02:35 +0800, Yichong Chen wrote:
> After the extent tree is transferred to the original inode,
> ext4_journal_ensure_credits() can fail before tmp_inode is cleared. The
> subsequent iput(tmp_inode) may then free the transferred tree.
>
> Move the existing resets of tmp_inode's size, block count and checksum
> seed before ext4_journal_ensure_credits(). This leaves the temporary inode
> ready for eviction even if obtaining journal credits fails. Keep
> ext4_ext_tree_init(), which marks the inode dirty, after the credits check.
>
> [...]

Applied, thanks!

[1/1] ext4: drop tmp inode ownership before migration cleanup
commit: ed8c07b7692cef7e4794db915bf3b8d988e3b6da

Best regards,
--
Theodore Ts'o <tytso@xxxxxxx>