diff mbox series

[f2fs-dev,v2] f2fs: fix the wrong f2fs_bug_on condition in f2fs_do_replace_block

Message ID 20241021023147.1774412-1-weilongping@oppo.com (mailing list archive)
State Accepted
Commit 522e5de97dc1b1c362604ed39482737c072ff982
Headers show
Series [f2fs-dev,v2] f2fs: fix the wrong f2fs_bug_on condition in f2fs_do_replace_block | expand

Commit Message

LongPing Wei Oct. 21, 2024, 2:31 a.m. UTC
This f2fs_bug_on was introduced by commit 2c1905042c8c ("f2fs: check
segment type in __f2fs_replace_block") when there were only 6 curseg types.
After commit d0b9e42ab615 ("f2fs: introduce inmem curseg") was introduced,
the condition should be changed to checking curseg->seg_type.

Fixes: d0b9e42ab615 ("f2fs: introduce inmem curseg")
Signed-off-by: LongPing Wei <weilongping@oppo.com>
---
 fs/f2fs/segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Chao Yu Oct. 21, 2024, 8:51 a.m. UTC | #1
On 2024/10/21 10:31, LongPing Wei wrote:
> This f2fs_bug_on was introduced by commit 2c1905042c8c ("f2fs: check
> segment type in __f2fs_replace_block") when there were only 6 curseg types.
> After commit d0b9e42ab615 ("f2fs: introduce inmem curseg") was introduced,
> the condition should be changed to checking curseg->seg_type.
> 
> Fixes: d0b9e42ab615 ("f2fs: introduce inmem curseg")
> Signed-off-by: LongPing Wei <weilongping@oppo.com>

Reviewed-by: Chao Yu <chao@kernel.org>

Thanks,
patchwork-bot+f2fs--- via Linux-f2fs-devel Oct. 28, 2024, 5:40 p.m. UTC | #2
Hello:

This patch was applied to jaegeuk/f2fs.git (dev)
by Jaegeuk Kim <jaegeuk@kernel.org>:

On Mon, 21 Oct 2024 10:31:47 +0800 you wrote:
> This f2fs_bug_on was introduced by commit 2c1905042c8c ("f2fs: check
> segment type in __f2fs_replace_block") when there were only 6 curseg types.
> After commit d0b9e42ab615 ("f2fs: introduce inmem curseg") was introduced,
> the condition should be changed to checking curseg->seg_type.
> 
> Fixes: d0b9e42ab615 ("f2fs: introduce inmem curseg")
> Signed-off-by: LongPing Wei <weilongping@oppo.com>
> 
> [...]

Here is the summary with links:
  - [f2fs-dev,v2] f2fs: fix the wrong f2fs_bug_on condition in f2fs_do_replace_block
    https://git.kernel.org/jaegeuk/f2fs/c/522e5de97dc1

You are awesome, thank you!
diff mbox series

Patch

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 1766254279d2..7b54b1851d34 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -3977,8 +3977,8 @@  void f2fs_do_replace_block(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
 		}
 	}
 
-	f2fs_bug_on(sbi, !IS_DATASEG(type));
 	curseg = CURSEG_I(sbi, type);
+	f2fs_bug_on(sbi, !IS_DATASEG(curseg->seg_type));
 
 	mutex_lock(&curseg->curseg_mutex);
 	down_write(&sit_i->sentry_lock);