mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
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:
@@ -71,6 +71,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 * 1024U)
|
||||
|
||||
/*
|
||||
* For mount options
|
||||
*/
|
||||
|
||||
@@ -215,7 +215,8 @@ static inline void limit_reserve_root(struct f2fs_sb_info *sbi)
|
||||
{
|
||||
block_t limit = (sbi->user_block_count << 1) / 1000;
|
||||
|
||||
/* limit is 0.2% */
|
||||
/* limit is 0.2%, and cannot be too small */
|
||||
limit = max(limit, MIN_ROOT_RESERVED_BLOCKS);
|
||||
if (test_opt(sbi, RESERVE_ROOT) &&
|
||||
F2FS_OPTION(sbi).root_reserved_blocks > limit) {
|
||||
F2FS_OPTION(sbi).root_reserved_blocks = limit;
|
||||
|
||||
Reference in New Issue
Block a user