Skip to content

Commit

Permalink
ext4: fix incorrect type issue during replay_del_range
Browse files Browse the repository at this point in the history
commit 8fca8a2 upstream.

should not use fast commit log data directly, add le32_to_cpu().

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 0b5b5a6 ("ext4: use ext4_ext_remove_space() for fast commit replay delete range")
Cc: stable@kernel.org
Signed-off-by: Xin Yin <yinxin.x@bytedance.com>
Reviewed-by: Ritesh Harjani <riteshh@linux.ibm.com>
Link: https://lore.kernel.org/r/20220126063146.2302-1-yinxin.x@bytedance.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Xin Yin authored and gregkh committed Feb 8, 2022
1 parent 1b6762e commit f187dae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/ext4/fast_commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -1816,8 +1816,9 @@ ext4_fc_replay_del_range(struct super_block *sb, struct ext4_fc_tl *tl,
}

down_write(&EXT4_I(inode)->i_data_sem);
ret = ext4_ext_remove_space(inode, lrange.fc_lblk,
lrange.fc_lblk + lrange.fc_len - 1);
ret = ext4_ext_remove_space(inode, le32_to_cpu(lrange.fc_lblk),
le32_to_cpu(lrange.fc_lblk) +
le32_to_cpu(lrange.fc_len) - 1);
up_write(&EXT4_I(inode)->i_data_sem);
if (ret)
goto out;
Expand Down

0 comments on commit f187dae

Please sign in to comment.