Skip to content

Commit

Permalink
f2fs: fix the wrong f2fs_bug_on condition in f2fs_do_replace_block
Browse files Browse the repository at this point in the history
[ Upstream commit c3af1f1 ]

This f2fs_bug_on was introduced by commit 2c19050 ("f2fs: check
segment type in __f2fs_replace_block") when there were only 6 curseg types.
After commit d0b9e42 ("f2fs: introduce inmem curseg") was introduced,
the condition should be changed to checking curseg->seg_type.

Fixes: d0b9e42 ("f2fs: introduce inmem curseg")
Signed-off-by: LongPing Wei <weilongping@oppo.com>
Reviewed-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
LongPing Wei authored and gregkh committed Dec 5, 2024
1 parent c31c7b8 commit 9b57a3f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/f2fs/segment.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9b57a3f

Please sign in to comment.