I have done the following
Steps to reproduce
Create an EXT4 filesystem with 160 MiB:
container volume create -s 160M size-test
stat -f%z ~/Library/Application\ Support/com.apple.container/volumes/size-test/volume.img
Current behavior
When creating an EXT4 filesystem, the requested size is expanded to the nearest block group boundary. A filesystem whose requested size falls between two block group boundaries ends up larger than requested - 256 MiB:
Expected behavior
The fix is to support a partial last block group so the filesystem uses exactly the requested size - 160 MiB:
Environment
Relevant log output
Code of Conduct
Related to #640.