Commit e51bba02 authored by Sahitya Tummala's avatar Sahitya Tummala
Browse files

f2fs: Fix indefinite loop in f2fs_gc()



Policy - foreground GC, LFS mode and greedy GC mode.

Under this policy, f2fs_gc() loops forever to GC as it doesn't have
enough free segements to proceed and thus it keeps calling gc_more
for the same victim segment.  This can happen if the selected victim
segment could not be GC'd due to failed blkaddr validity check i.e.
is_alive() returns false for the blocks set in current validity map.

Fix this by not resetting the sbi->cur_victim_sec to NULL_SEGNO, when
the segment selected could not be GC'd. This helps to select another
segment for GC and thus helps to proceed forward with GC.

[Note]
This can happen due to is_alive as well as atomic_file which skipps
GC.

Change-Id: Id56c8e898144aa5fd8a2616c3ee0575d7cca2cbc
Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
Git-commit: 957fa47823dfe449c5a15a944e4e7a299a6601db
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs.git/


Signed-off-by: default avatarSahitya Tummala <stummala@codeaurora.org>
parent 16c52e65
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment