]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: refactor the block allocation process of ext4_page_mkwrite()
authorZhang Yi <yi.zhang@huawei.com>
Mon, 7 Jul 2025 14:08:07 +0000 (22:08 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Aug 2025 14:49:41 +0000 (16:49 +0200)
commitab13e8cc3fb228c7bc4a08aa309769cbe37729b8
tree61749752737955eb8d9c2bc87ba7bc3f0c5ad2d4
parent98571b628c61e8129dfc24d60544385833fbcd12
ext4: refactor the block allocation process of ext4_page_mkwrite()

commit 2bddafea3d0d85ee9ac3cf5ba9a4b2f2d2f50257 upstream.

The block allocation process and error handling in ext4_page_mkwrite()
is complex now. Refactor it by introducing a new helper function,
ext4_block_page_mkwrite(). It will call ext4_block_write_begin() to
allocate blocks instead of directly calling block_page_mkwrite().
Preparing to implement retry logic in a subsequent patch to address
situations where the reserved journal credits are insufficient.
Additionally, this modification will help prevent potential deadlocks
that may occur when waiting for folio writeback while holding the
transaction handle.

Suggested-by: Jan Kara <jack@suse.cz>
Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://patch.msgid.link/20250707140814.542883-5-yi.zhang@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/inode.c