Skip to content

Commit 8fca8a2

Browse files
Xin Yintytso
authored andcommitted
ext4: fix incorrect type issue during replay_del_range
should not use fast commit log data directly, add le32_to_cpu(). Reported-by: kernel test robot <[email protected]> Fixes: 0b5b5a6 ("ext4: use ext4_ext_remove_space() for fast commit replay delete range") Cc: [email protected] Signed-off-by: Xin Yin <[email protected]> Reviewed-by: Ritesh Harjani <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 715a67f commit 8fca8a2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/ext4/fast_commit.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,8 +1794,9 @@ ext4_fc_replay_del_range(struct super_block *sb, struct ext4_fc_tl *tl,
17941794
}
17951795

17961796
down_write(&EXT4_I(inode)->i_data_sem);
1797-
ret = ext4_ext_remove_space(inode, lrange.fc_lblk,
1798-
lrange.fc_lblk + lrange.fc_len - 1);
1797+
ret = ext4_ext_remove_space(inode, le32_to_cpu(lrange.fc_lblk),
1798+
le32_to_cpu(lrange.fc_lblk) +
1799+
le32_to_cpu(lrange.fc_len) - 1);
17991800
up_write(&EXT4_I(inode)->i_data_sem);
18001801
if (ret)
18011802
goto out;

0 commit comments

Comments
 (0)