Skip to content

Commit cc742fd

Browse files
Yang Erkuntytso
authored andcommitted
ext4: correct the comments place for EXT4_EXT_MAY_ZEROOUT
Move the comments just before we set EXT4_EXT_MAY_ZEROOUT in ext4_split_convert_extents. Signed-off-by: Yang Erkun <yangerkun@huawei.com> Message-ID: <20251112084538.1658232-4-yangerkun@huawei.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent a927242 commit cc742fd

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

fs/ext4/extents.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3721,10 +3721,6 @@ static struct ext4_ext_path *ext4_split_convert_extents(handle_t *handle,
37213721
>> inode->i_sb->s_blocksize_bits;
37223722
if (eof_block < map->m_lblk + map->m_len)
37233723
eof_block = map->m_lblk + map->m_len;
3724-
/*
3725-
* It is safe to convert extent to initialized via explicit
3726-
* zeroout only if extent is fully inside i_size or new_size.
3727-
*/
37283724
depth = ext_depth(inode);
37293725
ex = path[depth].p_ext;
37303726
ee_block = le32_to_cpu(ex->ee_block);
@@ -3735,6 +3731,10 @@ static struct ext4_ext_path *ext4_split_convert_extents(handle_t *handle,
37353731
split_flag |= EXT4_EXT_DATA_VALID1;
37363732
/* Convert to initialized */
37373733
} else if (flags & EXT4_GET_BLOCKS_CONVERT) {
3734+
/*
3735+
* It is safe to convert extent to initialized via explicit
3736+
* zeroout only if extent is fully inside i_size or new_size.
3737+
*/
37383738
split_flag |= ee_block + ee_len <= eof_block ?
37393739
EXT4_EXT_MAY_ZEROOUT : 0;
37403740
split_flag |= (EXT4_EXT_MARK_UNWRIT2 | EXT4_EXT_DATA_VALID2);

0 commit comments

Comments
 (0)