diff options
author | Chao Yu <chao@kernel.org> | 2025-07-24 16:01:43 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-08-15 16:39:19 +0200 |
commit | facb02af487ef9d82f0833c5f4d108633eee637e (patch) | |
tree | 114fced2096038f01e829c9811888a3883d01d14 | |
parent | df63cd87cc0917b3aa2a027eb555abd9e1d45774 (diff) |
f2fs: fix to calculate dirty data during has_not_enough_free_secs()
[ Upstream commit e194e140ab7de2ce2782e64b9e086a43ca6ff4f2 ]
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: 36abef4e796d ("f2fs: introduce mode=lfs mount option")
Cc: Daeho Jeong <daehojeong@google.com>
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | fs/f2fs/segment.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index f11822ec3fec..a8ac5309bd90 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -674,8 +674,7 @@ static inline void __get_secs_required(struct f2fs_sb_info *sbi, unsigned int dent_blocks = total_dent_blocks % CAP_BLKS_PER_SEC(sbi); unsigned int data_blocks = 0; - if (f2fs_lfs_mode(sbi) && - unlikely(is_sbi_flag_set(sbi, SBI_CP_DISABLED))) { + if (f2fs_lfs_mode(sbi)) { total_data_blocks = get_pages(sbi, F2FS_DIRTY_DATA); data_secs = total_data_blocks / CAP_BLKS_PER_SEC(sbi); data_blocks = total_data_blocks % CAP_BLKS_PER_SEC(sbi); |