ChangeLog, initialize.c:
initialize.c (ext2fs_initialize): Make sure that we allocate enough
inodes so that we can make a valid filesystem.
diff --git a/lib/ext2fs/initialize.c b/lib/ext2fs/initialize.c
index c97a5bb..20c8161 100644
--- a/lib/ext2fs/initialize.c
+++ b/lib/ext2fs/initialize.c
@@ -161,6 +161,13 @@
set_field(s_inodes_count, super->s_blocks_count/(4096/fs->blocksize));
/*
+ * Make sure we have at least EXT2_FIRST_INO + 1 inodes, so
+ * that we have enough inodes for the filesystem(!)
+ */
+ if (super->s_inodes_count < EXT2_FIRST_INO(super)+1)
+ super->s_inodes_count = EXT2_FIRST_INO(super)+1;
+
+ /*
* There should be at least as many inodes as the user
* requested. Figure out how many inodes per group that
* should be. But make sure that we don't allocate more than