]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
ext4: remove duplicate check for EXT4_FC_REPLAY
authorJinliang Zheng <alexjlzheng@tencent.com>
Tue, 29 Apr 2025 11:17:22 +0000 (19:17 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 11 Jul 2025 01:33:03 +0000 (21:33 -0400)
EXT4_FC_REPLAY will be checked in ext4_es_lookup_extent(). If it is
set, ext4_es_lookup_extent() will return 0.

Remove the repeated check for EXT4_FC_REPLAY in ext4_map_blocks()
to simplify the code.

Signed-off-by: Jinliang Zheng <alexjlzheng@tencent.com>
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
Link: https://patch.msgid.link/20250429111722.294975-1-alexjlzheng@tencent.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/inode.c

index be9a4cba35fd523adce76b3b22a9677fbd86264b..a798e7c15fb5651b798aebb879d4f1f2a1a614e4 100644 (file)
@@ -723,8 +723,7 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode,
                ext4_check_map_extents_env(inode);
 
        /* Lookup extent status tree firstly */
-       if (!(EXT4_SB(inode->i_sb)->s_mount_state & EXT4_FC_REPLAY) &&
-           ext4_es_lookup_extent(inode, map->m_lblk, NULL, &es)) {
+       if (ext4_es_lookup_extent(inode, map->m_lblk, NULL, &es)) {
                if (ext4_es_is_written(&es) || ext4_es_is_unwritten(&es)) {
                        map->m_pblk = ext4_es_pblock(&es) +
                                        map->m_lblk - es.es_lblk;