Skip to content

Commit

Permalink
libext2fs: don't report garbage inodes with really large inodes
Browse files Browse the repository at this point in the history
If the inode size is large enough that there are fewer than two inodes
per block, don't report an inode checksum failure as a garbage inode
during the scan because the "more than half are broken" criteria that
we use to decide if a block of inodes is garbage doesn't really apply.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
  • Loading branch information
djwong authored and tytso committed Dec 3, 2014
1 parent bbf29ce commit 54f6faf
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/ext2fs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,9 @@ static void check_inode_block_sanity(ext2_inode_scan scan, blk64_t num_blocks)
memset(block_status, 0, scan->inode_buffer_blocks);
inodes_per_block = EXT2_INODES_PER_BLOCK(scan->fs->super);

if (inodes_per_block < 2)
return;

#ifdef WORDS_BIGENDIAN
if (ext2fs_get_mem(EXT2_INODE_SIZE(scan->fs->super), &inode))
return;
Expand Down

0 comments on commit 54f6faf

Please sign in to comment.