This is a note to let you know that I've just added the patch titled f2fs: increase the limit for reserve_root to the 5.19-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: f2fs-increase-the-limit-for-reserve_root.patch and it can be found in the queue-5.19 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From da35fe96d12d15779f3cb74929b7ed03941cf983 Mon Sep 17 00:00:00 2001 From: Jaegeuk Kim <jaegeuk@xxxxxxxxxx> Date: Tue, 23 Aug 2022 10:18:42 -0700 Subject: f2fs: increase the limit for reserve_root From: Jaegeuk Kim <jaegeuk@xxxxxxxxxx> commit da35fe96d12d15779f3cb74929b7ed03941cf983 upstream. This patch increases the threshold that limits the reserved root space from 0.2% to 12.5% by using simple shift operation. Typically Android sets 128MB, but if the storage capacity is 32GB, 0.2% which is around 64MB becomes too small. Let's relax it. Cc: stable@xxxxxxxxxxxxxxx Reported-by: Aran Dalton <arda@xxxxxxxxxxxxxxxxx> Reviewed-by: Chao Yu <chao@xxxxxxxxxx> Signed-off-by: Jaegeuk Kim <jaegeuk@xxxxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/f2fs/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -298,10 +298,10 @@ static void f2fs_destroy_casefold_cache( static inline void limit_reserve_root(struct f2fs_sb_info *sbi) { - block_t limit = min((sbi->user_block_count << 1) / 1000, + block_t limit = min((sbi->user_block_count >> 3), sbi->user_block_count - sbi->reserved_blocks); - /* limit is 0.2% */ + /* limit is 12.5% */ if (test_opt(sbi, RESERVE_ROOT) && F2FS_OPTION(sbi).root_reserved_blocks > limit) { F2FS_OPTION(sbi).root_reserved_blocks = limit; Patches currently in stable-queue which might be from jaegeuk@xxxxxxxxxx are queue-5.19/f2fs-increase-the-limit-for-reserve_root.patch queue-5.19/f2fs-fix-to-do-sanity-check-on-destination-blkaddr-during-recovery.patch queue-5.19/f2fs-complete-checkpoints-during-remount.patch queue-5.19/f2fs-flush-pending-checkpoints-when-freezing-super.patch queue-5.19/f2fs-fix-to-do-sanity-check-on-summary-info.patch queue-5.19/f2fs-fix-wrong-continue-condition-in-gc.patch