From: Darrick J. Wong Date: Wed, 3 Dec 2014 03:17:10 +0000 (-0500) Subject: libext2fs: don't report garbage inodes with really large inodes X-Git-Tag: v1.43-WIP-2015-05-18~132 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=54f6faf7f2897155a8341142539178532732d7af;p=tools%2Fe2fsprogs.git libext2fs: don't report garbage inodes with really large inodes 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 Signed-off-by: Theodore Ts'o --- diff --git a/lib/ext2fs/inode.c b/lib/ext2fs/inode.c index 4310b82..ff7009b 100644 --- a/lib/ext2fs/inode.c +++ b/lib/ext2fs/inode.c @@ -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;