Repository navigation
Commit bbf9f7d
f2fs: Fix indefinite loop in f2fs_gc()
Policy - Foreground GC, LFS 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 keeping track of such invalid segments and skip those
segments for selection in get_victim_by_default() to avoid endless
GC loop under such error scenarios. Currently, add this logic under
CONFIG_F2FS_CHECK_FS to be able to root cause the issue in debug
version.
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
[Jaegeuk Kim: fix wrong bitmap size]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>1 parent 2fde3dd commit bbf9f7d
3 files changed
Lines changed: 46 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
385 | 395 | | |
386 | 396 | | |
387 | 397 | | |
| |||
627 | 637 | | |
628 | 638 | | |
629 | 639 | | |
630 | | - | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
631 | 653 | | |
| 654 | + | |
632 | 655 | | |
633 | 656 | | |
634 | 657 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
817 | 817 | | |
818 | 818 | | |
819 | 819 | | |
820 | | - | |
| 820 | + | |
821 | 821 | | |
822 | 822 | | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
823 | 827 | | |
824 | 828 | | |
825 | 829 | | |
| |||
3946 | 3950 | | |
3947 | 3951 | | |
3948 | 3952 | | |
3949 | | - | |
| 3953 | + | |
3950 | 3954 | | |
3951 | 3955 | | |
3952 | 3956 | | |
| |||
3962 | 3966 | | |
3963 | 3967 | | |
3964 | 3968 | | |
3965 | | - | |
3966 | | - | |
| 3969 | + | |
| 3970 | + | |
3967 | 3971 | | |
3968 | 3972 | | |
3969 | 3973 | | |
| |||
4012 | 4016 | | |
4013 | 4017 | | |
4014 | 4018 | | |
4015 | | - | |
| 4019 | + | |
4016 | 4020 | | |
4017 | 4021 | | |
4018 | | - | |
| 4022 | + | |
4019 | 4023 | | |
4020 | 4024 | | |
4021 | 4025 | | |
4022 | 4026 | | |
4023 | | - | |
| 4027 | + | |
| 4028 | + | |
4024 | 4029 | | |
4025 | 4030 | | |
| 4031 | + | |
| 4032 | + | |
| 4033 | + | |
| 4034 | + | |
| 4035 | + | |
4026 | 4036 | | |
4027 | 4037 | | |
4028 | 4038 | | |
| |||
4031 | 4041 | | |
4032 | 4042 | | |
4033 | 4043 | | |
4034 | | - | |
| 4044 | + | |
4035 | 4045 | | |
4036 | 4046 | | |
4037 | 4047 | | |
| |||
4514 | 4524 | | |
4515 | 4525 | | |
4516 | 4526 | | |
| 4527 | + | |
4517 | 4528 | | |
4518 | 4529 | | |
4519 | 4530 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
233 | 236 | | |
234 | 237 | | |
235 | 238 | | |
| |||
0 commit comments