f2fs: check number of blocks in a current section
Jaegeuk Kim
maintainerPATCH 1/3 f2fs: check number of blocks in a current section
In cfd66bb715fd ("f2fs: fix deadloop in foreground GC"), we needed to check the number of blocks in a section instead of the segment.
Fixes cfd66bb715fd ("f2fs: fix deadloop in foreground GC")
Signed-off-by Jaegeuk Kim <[email protected]>
--- fs/f2fs/segment.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
fs/f2fs/segment.h +4 -4
@@ -560,16 +560,16 @@ static inline bool has_curseg_enough_space(struct f2fs_sb_info *sbi,/* check current node segment */ for (i =CURSEG_HOT_NODE ; i <=CURSEG_COLD_NODE ; i++) { segno =CURSEG_I (sbi, i)->segno; - left_blocks =BLKS_PER_SEG (sbi) - -get_seg_entry (sbi, segno)->ckpt_valid_blocks; + left_blocks =BLKS_PER_SEC (sbi) - +get_ckpt_valid_blocks (sbi, segno, true);if (node_blocks > left_blocks)return false; }/* check current data segment */ segno =CURSEG_I (sbi,CURSEG_HOT_DATA )->segno; - left_blocks =BLKS_PER_SEG (sbi) - -get_seg_entry (sbi, segno)->ckpt_valid_blocks; + left_blocks =BLKS_PER_SEC (sbi) - +get_ckpt_valid_blocks (sbi, segno, true);if (dent_blocks > left_blocks)return false;return true;
Signature · 1 line
2.44.0.rc0.258.g7320e95886-goog
Jaegeuk Kim
maintainerPATCH 2/3 f2fs: prevent an f2fs_gc loop during disable_checkpoint
Don't get stuck in the f2fs_gc loop while disabling checkpoint. Instead, we have a time-based management.
Signed-off-by Jaegeuk Kim <[email protected]>
--- fs/f2fs/super.c | 1 + 1 file changed, 1 insertion(+)
fs/f2fs/super.c +1 -0
@@ -2190,6 +2190,7 @@ static int f2fs_disable_checkpoint(struct f2fs_sb_info *sbi) .init_gc_type = FG_GC, .should_migrate_blocks = false, .err_gc_skipped = true, + .no_bg_gc = true, .nr_free_secs = 1 };f2fs_down_write (&sbi->gc_lock);
Signature · 1 line
2.44.0.rc0.258.g7320e95886-goog
Jaegeuk Kim
maintainerPATCH 3/3 f2fs: allow to mount if cap is 100
In reply to Jaegeuk KimDon't block mounting the partition, if cap is 100%.
Signed-off-by Jaegeuk Kim <[email protected]>
--- fs/f2fs/segment.c | 3 +++ 1 file changed, 3 insertions(+)
fs/f2fs/segment.c +3 -0
@@ -894,6 +894,9 @@ int f2fs_disable_cp_again(struct f2fs_sb_info *sbi, block_t unusable) {int ovp_hole_segs = (overprovision_segments (sbi) -reserved_segments (sbi)); + +if (F2FS_OPTION (sbi).unusable_cap_perc ==100 ) +return 0 ;if (unusable >F2FS_OPTION (sbi).unusable_cap)return -EAGAIN ; if (is_sbi_flag_set(sbi, SBI_CP_DISABLED_QUICK) &&
Signature · 1 line
2.44.0.rc0.258.g7320e95886-goog