summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChao Yu <chao@kernel.org>2025-07-24 11:01:42 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-08-15 13:14:01 +0300
commit3908f15df598023e8cb9c9dc72ca8f2aa290e75b (patch)
treec2fde236beb40ed346a7cc74e7e8c747d4c2a17d
parent0fe7976b62546f1e95eebfe9879925e9aa22b7a8 (diff)
downloadlinux-3908f15df598023e8cb9c9dc72ca8f2aa290e75b.tar.xz
f2fs: fix to update upper_p in __get_secs_required() correctly
[ Upstream commit 6840faddb65683b4e7bd8196f177b038a1e19faf ] 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 <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.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
index 52bb1a281935..7d7d709b55ff 100644
--- a/fs/f2fs/segment.h
+++ b/fs/f2fs/segment.h
@@ -636,7 +636,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)