Skip to content

Commit c00a629

Browse files
Zhihao Chengtytso
authored andcommitted
ext4: support large block size in __ext4_block_zero_page_range()
Use the EXT4_PG_TO_LBLK() macro to convert folio indexes to blocks to avoid negative left shifts after supporting blocksize greater than PAGE_SIZE. Signed-off-by: Zhihao Cheng <chengzhihao1@huawei.com> Signed-off-by: Baokun Li <libaokun1@huawei.com> Reviewed-by: Zhang Yi <yi.zhang@huawei.com> Reviewed-by: Jan Kara <jack@suse.cz> Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com> Message-ID: <20251121090654.631996-21-libaokun@huaweicloud.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent 8e50e23 commit c00a629

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/ext4/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4076,7 +4076,7 @@ static int __ext4_block_zero_page_range(handle_t *handle,
40764076

40774077
blocksize = inode->i_sb->s_blocksize;
40784078

4079-
iblock = folio->index << (PAGE_SHIFT - inode->i_sb->s_blocksize_bits);
4079+
iblock = EXT4_PG_TO_LBLK(inode, folio->index);
40804080

40814081
bh = folio_buffers(folio);
40824082
if (!bh)

0 commit comments

Comments
 (0)