+1998-06-16 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * read_bb.c (ext2fs_read_bb_inode): Make function more robust
+ against a completely trashed bad block inode.
+
1998-06-10 Theodore Ts'o <tytso@rsts-11.mit.edu>
* alloc_tables.c (ext2fs_allocate_group_table): Fix bug so that if
if (blockcnt < 0)
return 0;
+ if ((*block_nr < fs->super->s_first_data_block) ||
+ (*block_nr >= fs->super->s_blocks_count))
+ return 0; /* Ignore illegal blocks */
+
rb->err = ext2fs_badblocks_list_add(rb->bb_list, *block_nr);
if (rb->err)
return BLOCK_ABORT;
retval = ext2fs_read_inode(fs, EXT2_BAD_INO, &inode);
if (retval)
return retval;
- numblocks = (inode.i_blocks / (fs->blocksize / 512)) + 20;
+ if (inode.i_blocks < 500)
+ numblocks = (inode.i_blocks /
+ (fs->blocksize / 512)) + 20;
+ else
+ numblocks = 500;
retval = ext2fs_badblocks_list_create(bb_list, numblocks);
if (retval)
return retval;