On Wed, Mar 14, 2018 at 05:47:00AM +0000, Kazuya Mio wrote: > When read_bitmaps() is called to read block/inode bitmap from the image file > created by e2image, it can read only one bitmap block due to the wrong > loop condition. read_bitmaps() doesn't need to split the code between > the filesystem and the image file, so remove EXT2_FLAG_IMAGE_FILE-specific code. I see the bug you are trying to fix, but I'll note that your patch has the following changes from the orignial code 1) It causes the I/O patterns to be much more seeky, since we are jumping back and forth between the inode bitmap portion of the image file and block bitmap portion of the image file. The original code read the bitmaps using sequential reads, which allows the readahead code to more efficiently read the information from disk. 2) It forces a metadata checksum check where previously we were not doing one. This could make a difference if someone performs an e2image snapshot of a life file system, for example. It might be better to add two new variables which are initalized to {block,inode}_nbytes multipled by the number of block groups, and fix the loop condition, and keep the existing code. Regards, - Ted