]> git.ipfire.org Git - thirdparty/kernel/linux.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)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 14 Jul 2025 03:41:51 +0000 (23:41 -0400)
commit2bddafea3d0d85ee9ac3cf5ba9a4b2f2d2f50257
tree50fe0bac381e757018b00bd85abfe5bcebd9646f
parentded2d726a3041fce8afd88005cbfe15cd4737702
ext4: refactor the block allocation process of ext4_page_mkwrite()

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>
fs/ext4/inode.c