On Fri, Jun 29, 2018 at 02:06:03AM +0000, Gaoming (ming, consumer BG) wrote: > We use usual inode size, it is 256 bytes. > > Yes, this commit is in my repository. > But there is a bug in this patch. > > Let me show you, > Here is the bug: " return ALIGN(inodes, (info.block_size / info.inode_size));" > > In my reproduce, > info.block_size = 1024, (it is legal) > info.inode_size =256, But why are you using a block size of 1024? It's legal, but in general, it's a bad idea (often will hurt performance, will impose additional scalability limitations, etc.).... It's certainly not the default. A block size of 1024 is also incompatible with file-based encryption (FBE), which is required for a number of Android features. Support for FBE is strongly required, and it wouldn't surprise me if it becomes an mandatory requirement at some point in the future. How long have you been using a block size of 1024, and why? > But in real scenario, we should align by 8,( 8 bit per bytes in inode map). Yes, and that's why mke2fs does. make_ext4fs was an Android specific abomination, that I've been pushing hard for Android to rid itself of. This is not the only thing it's gotten wrong in the past, and I've had to help Android developers deal with data corrupting bugs caused by the fact that way back when, Android had a GPL-in-userspace allergy. - Ted