diff options
author | Xin Yin <yinxin.x@bytedance.com> | 2022-01-26 14:31:46 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-02-08 18:35:19 +0100 |
commit | a17cde2d2e751bb9c236c02e26ea4ddbecf71005 (patch) | |
tree | 55b1499d918484a291419c7165903d2a3f5e5185 | |
parent | 14aa3f49c7fc6424763f4323bfbc3a807b0727dc (diff) | |
download | linux-stable-a17cde2d2e751bb9c236c02e26ea4ddbecf71005.tar.gz linux-stable-a17cde2d2e751bb9c236c02e26ea4ddbecf71005.tar.bz2 linux-stable-a17cde2d2e751bb9c236c02e26ea4ddbecf71005.zip |
ext4: fix incorrect type issue during replay_del_range
commit 8fca8a2b0a822f7936130af7299d2fd7f0a66714 upstream.
should not use fast commit log data directly, add le32_to_cpu().
Reported-by: kernel test robot <lkp@intel.com>
Fixes: 0b5b5a62b945 ("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>
-rw-r--r-- | fs/ext4/fast_commit.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c index 251bad808fd9..3b79fb063c07 100644 --- a/fs/ext4/fast_commit.c +++ b/fs/ext4/fast_commit.c @@ -1819,8 +1819,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; |