Skip to content

Commit 7f10357

Browse files
Jaegeuk Kimgregkh
authored andcommitted
f2fs: increase the limit for reserve_root
commit da35fe9 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: [email protected] Reported-by: Aran Dalton <[email protected]> Reviewed-by: Chao Yu <[email protected]> Signed-off-by: Jaegeuk Kim <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 0035b84 commit 7f10357

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

fs/f2fs/super.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,10 +306,10 @@ static void f2fs_destroy_casefold_cache(void) { }
306306

307307
static inline void limit_reserve_root(struct f2fs_sb_info *sbi)
308308
{
309-
block_t limit = min((sbi->user_block_count << 1) / 1000,
309+
block_t limit = min((sbi->user_block_count >> 3),
310310
sbi->user_block_count - sbi->reserved_blocks);
311311

312-
/* limit is 0.2% */
312+
/* limit is 12.5% */
313313
if (test_opt(sbi, RESERVE_ROOT) &&
314314
F2FS_OPTION(sbi).root_reserved_blocks > limit) {
315315
F2FS_OPTION(sbi).root_reserved_blocks = limit;

0 commit comments

Comments
 (0)