2 * Play with a file system image quickly to find UBSAN problems
4 * Run a file system through some of the libext2fs functions used by
13 #include <sys/types.h>
16 #include <ext2fs/ext2_fs.h>
17 #include <ext2fs/ext2fs.h>
19 int main (int argc
, char *argv
[])
25 initialize_ext2_error_table();
28 fprintf(stderr
, "%s: Usage <device|filesystem>\n", argv
[0]);
32 retval
= ext2fs_open(argv
[1], 0, 0, 0,
33 unix_io_manager
, &fs
);
35 com_err(argv
[0], retval
, "while trying to open '%s'",
40 retval
= ext2fs_read_inode_bitmap(fs
);
42 com_err(argv
[0], retval
, "while trying to read inode bitmaps");
46 retval
= ext2fs_read_block_bitmap(fs
);
48 com_err(argv
[0], retval
, "while trying to read inode bitmaps");
52 retval
= ext2fs_check_directory(fs
, EXT2_ROOT_INO
);
54 com_err(argv
[0], retval
, "while trying to read inode bitmaps");