mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
f2fs: fix uninitialized skipped_gc_rwsem
[ Upstream commitc17caf0ba3
] When f2fs skipped a gc round during victim migration, there was a bug which would skip all upcoming gc rounds unconditionally because skipped_gc_rwsem was not initialized. It fixes the bug by correctly initializing the skipped_gc_rwsem inside the gc loop. Fixes:6f8d445506
("f2fs: avoid fi->i_gc_rwsem[WRITE] lock in f2fs_gc") Signed-off-by: Yonggil Song <yonggil.song@samsung.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
48b2b82f98
commit
a847b4c4ac
1 changed files with 1 additions and 1 deletions
|
@ -1795,8 +1795,8 @@ int f2fs_gc(struct f2fs_sb_info *sbi, struct f2fs_gc_control *gc_control)
|
||||||
prefree_segments(sbi));
|
prefree_segments(sbi));
|
||||||
|
|
||||||
cpc.reason = __get_cp_reason(sbi);
|
cpc.reason = __get_cp_reason(sbi);
|
||||||
sbi->skipped_gc_rwsem = 0;
|
|
||||||
gc_more:
|
gc_more:
|
||||||
|
sbi->skipped_gc_rwsem = 0;
|
||||||
if (unlikely(!(sbi->sb->s_flags & SB_ACTIVE))) {
|
if (unlikely(!(sbi->sb->s_flags & SB_ACTIVE))) {
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
goto stop;
|
goto stop;
|
||||||
|
|
Loading…
Reference in a new issue