f2fs: add a new limit for reserve root

The reserved root blocks is not enough for booting Android due to
the limit of 0.2% if the fs size too small. so we add a new mini-
mum limit is 128MB.

Change-Id: I5af3b182001d27e4d18b4090c5270bbb2ac6253b
Signed-off-by: Cliff Chen <cliff.chen@rock-chips.com>
This commit is contained in:
Cliff Chen
2018-07-16 14:40:48 +08:00
committed by Tao Huang
parent 773a33a1cc
commit 0729de642e
2 changed files with 4 additions and 1 deletions

View File

@@ -69,6 +69,8 @@ extern const char *f2fs_fault_name[FAULT_MAX];
#define IS_FAULT_SET(fi, type) ((fi)->inject_type & (1 << (type)))
#endif
#define MIN_ROOT_RESERVED_BLOCKS (128 * 1024 * 1024)
/*
* For mount options
*/

View File

@@ -280,7 +280,8 @@ static inline void limit_reserve_root(struct f2fs_sb_info *sbi)
/* limit is 0.2% */
if (test_opt(sbi, RESERVE_ROOT) &&
F2FS_OPTION(sbi).root_reserved_blocks > limit) {
F2FS_OPTION(sbi).root_reserved_blocks > limit &&
F2FS_OPTION(sbi).root_reserved_blocks > MIN_ROOT_RESERVED_BLOCKS) {
F2FS_OPTION(sbi).root_reserved_blocks = limit;
f2fs_info(sbi, "Reduce reserved blocks for root = %u",
F2FS_OPTION(sbi).root_reserved_blocks);