Whamcloud - gitweb
ext2fs: make sure we have at least EXT2_FIRST_INO + 1 inodes
authorLi Dongyang <dongyangli@ddn.com>
Thu, 20 Jul 2023 12:50:12 +0000 (22:50 +1000)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 8 Feb 2024 15:51:46 +0000 (10:51 -0500)
commit196cd1224ccaf5ca76540fc0a6238695d4476ca9
tree725a79efce02a4ab17595ec6db61917d9f3f53ac
parent633ab26eefe1b037eaba82d9a3555eb712c82345
ext2fs: make sure we have at least EXT2_FIRST_INO + 1 inodes

When creating a small fs with 100 1k blocks, mke2fs fails with:

Creating filesystem with 100 1k blocks and 8 inodes

Allocating group tables: done
Writing inode tables: done
ext2fs_mkdir: Could not allocate inode in ext2 filesystem while creating /lost+found

Increase s_inodes_per_group with a step of 8 to make
sure we have at least EXT2_FIRST_INO + 1 inodes.

Change-Id: Ib885735641dfa0ed9c6f6a4a1f9afec291673126
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Link: https://lore.kernel.org/r/20230720125012.641504-1-dongyangli@ddn.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/initialize.c