]> Gentwo Git Trees - linux/.git/commitdiff
ext4: correct the comments place for EXT4_EXT_MAY_ZEROOUT
authorYang Erkun <yangerkun@huawei.com>
Wed, 12 Nov 2025 08:45:38 +0000 (16:45 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Wed, 26 Nov 2025 22:13:34 +0000 (17:13 -0500)
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>
fs/ext4/extents.c

index b9be5d8320de62a2ddece929c88a5607a90e0f5b..885e933b68034150e00e08cf1cf8d059084e0daf 100644 (file)
@@ -3721,10 +3721,6 @@ static struct ext4_ext_path *ext4_split_convert_extents(handle_t *handle,
                        >> inode->i_sb->s_blocksize_bits;
        if (eof_block < map->m_lblk + map->m_len)
                eof_block = map->m_lblk + map->m_len;
-       /*
-        * It is safe to convert extent to initialized via explicit
-        * zeroout only if extent is fully inside i_size or new_size.
-        */
        depth = ext_depth(inode);
        ex = path[depth].p_ext;
        ee_block = le32_to_cpu(ex->ee_block);
@@ -3735,6 +3731,10 @@ static struct ext4_ext_path *ext4_split_convert_extents(handle_t *handle,
                split_flag |= EXT4_EXT_DATA_VALID1;
        /* Convert to initialized */
        } else if (flags & EXT4_GET_BLOCKS_CONVERT) {
+               /*
+                * It is safe to convert extent to initialized via explicit
+                * zeroout only if extent is fully inside i_size or new_size.
+                */
                split_flag |= ee_block + ee_len <= eof_block ?
                              EXT4_EXT_MAY_ZEROOUT : 0;
                split_flag |= (EXT4_EXT_MARK_UNWRIT2 | EXT4_EXT_DATA_VALID2);