Skip to content

Commit e194e14

Browse files
chaseyuJaegeuk Kim
authored andcommitted
f2fs: fix to calculate dirty data during has_not_enough_free_secs()
In lfs mode, dirty data needs OPU, we'd better calculate lower_p and upper_p w/ them during has_not_enough_free_secs(), otherwise we may encounter out-of-space issue due to we missed to reclaim enough free section w/ foreground gc. Fixes: 36abef4 ("f2fs: introduce mode=lfs mount option") Cc: Daeho Jeong <[email protected]> Signed-off-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 6840fad commit e194e14

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/f2fs/segment.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,8 +668,7 @@ static inline void __get_secs_required(struct f2fs_sb_info *sbi,
668668
unsigned int dent_blocks = total_dent_blocks % CAP_BLKS_PER_SEC(sbi);
669669
unsigned int data_blocks = 0;
670670

671-
if (f2fs_lfs_mode(sbi) &&
672-
unlikely(is_sbi_flag_set(sbi, SBI_CP_DISABLED))) {
671+
if (f2fs_lfs_mode(sbi)) {
673672
total_data_blocks = get_pages(sbi, F2FS_DIRTY_DATA);
674673
data_secs = total_data_blocks / CAP_BLKS_PER_SEC(sbi);
675674
data_blocks = total_data_blocks % CAP_BLKS_PER_SEC(sbi);

0 commit comments

Comments
 (0)