Whamcloud - gitweb
libext2fs: fix ext2fs_open2() error for meta_bg image file
authorKazuya Mio <k-mio@sx.jp.nec.com>
Sat, 17 Mar 2018 18:56:15 +0000 (14:56 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 17 Mar 2018 18:56:15 +0000 (14:56 -0400)
commit8b061a641dff1a0becf645f8e6002de79b997b95
treeb627be9e7bf92e504edae449d16a17184fa96628
parenta126f79a0eee38762d8e3d110281ae86322de444
libext2fs: fix ext2fs_open2() error for meta_bg image file

dumpe2fs/debugfs can examine the image file by using the -i option.
However, if meta_bg feature is enabled, dumpe2fs/debugfs cannot open
the image file.

$ dumpe2fs -i test.img
dumpe2fs: Attempt to read block from filesystem resulted in short read while trying to open test.img
Couldn't find valid filesystem superblock.

In case of specifying an image file, the location of block group descriptors
is the same as the case of default filesystem regardless of meta_bg feature.
So if EXT2_FLAG_IMAGE_FILE flag is set in ext2fs_open2(),
don't use the meta_bg handling.

Signed-off-by: Kazuya Mio <k-mio@sx.jp.nec.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/openfs.c