diff options
author | Daniel Rosenberg <drosen@google.com> | 2023-11-17 18:03:08 -0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2023-11-28 10:55:59 -0800 |
commit | 97af7a106ebd7cd3596c1a1dc4073ff3e2ea253d (patch) | |
tree | ceea9b11988a186876f7b7099c9e1b5d387a79c1 | |
parent | 779bc5060641953674b32c5c8ddf4929ed261956 (diff) | |
download | f2fs-tools-97af7a106ebd7cd3596c1a1dc4073ff3e2ea253d.tar.gz |
f2fs-tools: Wait for Block Size to initialize Cache
The cache is initialized during the first read, however, it requires the
block size to establish its buffer. This disables the cache until the
block size is known.
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r-- | fsck/mount.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fsck/mount.c b/fsck/mount.c index 72516f4..658e601 100644 --- a/fsck/mount.c +++ b/fsck/mount.c @@ -3860,8 +3860,12 @@ int f2fs_do_mount(struct f2fs_sb_info *sbi) { struct f2fs_checkpoint *cp = NULL; struct f2fs_super_block *sb = NULL; + int num_cache_entry = c.cache_config.num_cache_entry; int ret; + /* Must not initiate cache until block size is known */ + c.cache_config.num_cache_entry = 0; + sbi->active_logs = NR_CURSEG_TYPE; ret = validate_super_block(sbi, SB0_ADDR); if (ret) { @@ -3881,6 +3885,7 @@ int f2fs_do_mount(struct f2fs_sb_info *sbi) } } sb = F2FS_RAW_SUPER(sbi); + c.cache_config.num_cache_entry = num_cache_entry; ret = check_sector_size(sb); if (ret) |