diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 7e6977173d28..65f21b9aab79 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -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 */ diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index c2ba4a087983..ed5e28f46ae8 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -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);