From: Chao Yu Date: Thu, 24 Jul 2025 08:01:42 +0000 (+0800) Subject: f2fs: fix to update upper_p in __get_secs_required() correctly X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=6840faddb65683b4e7bd8196f177b038a1e19faf;p=users%2Fdwmw2%2Flinux.git f2fs: fix to update upper_p in __get_secs_required() correctly Commit 1acd73edbbfe ("f2fs: fix to account dirty data in __get_secs_required()") missed to calculate upper_p w/ data_secs, fix it. Fixes: 1acd73edbbfe ("f2fs: fix to account dirty data in __get_secs_required()") Cc: Daeho Jeong Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h index d2c73f6411345..2123645cf1756 100644 --- a/fs/f2fs/segment.h +++ b/fs/f2fs/segment.h @@ -678,7 +678,7 @@ static inline void __get_secs_required(struct f2fs_sb_info *sbi, if (lower_p) *lower_p = node_secs + dent_secs + data_secs; if (upper_p) - *upper_p = node_secs + dent_secs + + *upper_p = node_secs + dent_secs + data_secs + (node_blocks ? 1 : 0) + (dent_blocks ? 1 : 0) + (data_blocks ? 1 : 0); if (curseg_p)