linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: fix incorrect type issue during replay_del_range
@ 2022-01-26  6:31 Xin Yin
  2022-01-27  5:13 ` Ritesh Harjani
  2022-01-29  4:43 ` Theodore Ts'o
  0 siblings, 2 replies; 3+ messages in thread
From: Xin Yin @ 2022-01-26  6:31 UTC (permalink / raw)
  To: harshadshirwadkar, tytso, adilger.kernel
  Cc: linux-ext4, linux-kernel, Xin Yin, kernel test robot

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")
Signed-off-by: Xin Yin <yinxin.x@bytedance.com>
---
 fs/ext4/fast_commit.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
index ccd2b216d6ba..488347b4c8b0 100644
--- a/fs/ext4/fast_commit.c
+++ b/fs/ext4/fast_commit.c
@@ -1798,8 +1798,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) {
 		iput(inode);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: fix incorrect type issue during replay_del_range
  2022-01-26  6:31 [PATCH] ext4: fix incorrect type issue during replay_del_range Xin Yin
@ 2022-01-27  5:13 ` Ritesh Harjani
  2022-01-29  4:43 ` Theodore Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Ritesh Harjani @ 2022-01-27  5:13 UTC (permalink / raw)
  To: Xin Yin
  Cc: harshadshirwadkar, tytso, adilger.kernel, linux-ext4,
	linux-kernel, kernel test robot

On 22/01/26 02:31PM, Xin Yin wrote:
> 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")
> Signed-off-by: Xin Yin <yinxin.x@bytedance.com>

Yes, a required change indeed.
Since the patch marked as fixes was cc'd to stable, so this might be requird as
well.

Reviewed-by: Ritesh Harjani <riteshh@linux.ibm.com>

> ---
>  fs/ext4/fast_commit.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c
> index ccd2b216d6ba..488347b4c8b0 100644
> --- a/fs/ext4/fast_commit.c
> +++ b/fs/ext4/fast_commit.c
> @@ -1798,8 +1798,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) {
>  		iput(inode);
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ext4: fix incorrect type issue during replay_del_range
  2022-01-26  6:31 [PATCH] ext4: fix incorrect type issue during replay_del_range Xin Yin
  2022-01-27  5:13 ` Ritesh Harjani
@ 2022-01-29  4:43 ` Theodore Ts'o
  1 sibling, 0 replies; 3+ messages in thread
From: Theodore Ts'o @ 2022-01-29  4:43 UTC (permalink / raw)
  To: adilger.kernel, harshadshirwadkar, Xin Yin
  Cc: Theodore Ts'o, linux-ext4, linux-kernel, kernel test robot

On Wed, 26 Jan 2022 14:31:46 +0800, Xin Yin wrote:
> should not use fast commit log data directly, add le32_to_cpu().
> 
> 

Applied, thanks!

[1/1] ext4: fix incorrect type issue during replay_del_range
      commit: 3f6a7abe77c1cbe125e2f743568c810470d66e7d

Best regards,
-- 
Theodore Ts'o <tytso@mit.edu>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-29  4:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26  6:31 [PATCH] ext4: fix incorrect type issue during replay_del_range Xin Yin
2022-01-27  5:13 ` Ritesh Harjani
2022-01-29  4:43 ` Theodore Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).