The dump_unused command in debugfs segfaults if used without an open
filesystem:
sor:~ # debugfs
debugfs 1.39 (29-May-2006)
debugfs: dump_unused
Segmentation fault
Patch (from IBM) below.
Signed-off-by: Matthias Koenig <mkoenig@suse.de>
+2007-01-28 Theodore Tso <tytso@mit.edu>
+
+ * unused.c: Fix bug so that the dump_unused command segfault if
+ used without an open filesystem
+
2006-12-22 Theodore Tso <tytso@mit.edu>
* debugfs.c (main): Use the new {add,remove}_error_table comerr
unsigned int i;
errcode_t retval;
+ if (common_args_process(argc, argv, 1, 1,
+ "dump_unused", "", 0))
+ return;
+
for (blk=current_fs->super->s_first_data_block;
blk < current_fs->super->s_blocks_count; blk++) {
if (ext2fs_test_block_bitmap(current_fs->block_map,blk))