update_engine: Fix metadata handling when inode table is in a different block group.
The inode table is stored in some metadata blocks and is local to each
block group in an ext2 filesystem. These tables are normally stored near
the beginning of the block group, together with the inode and block
bitmaps.
Appartenly, mkfs.ext2 can place the inode table for a given block group
outside the range of blocks of that block group. We have seen smaller
rootfs (400 MiB) where all the inode tables are grouped together near
the beginning of the filesystem, in the first block group.
This patch avoids an integer overflow when this happens and lets the
ReadUnwrittenBlocks() handle those tables.
BUG=chromium:478261
TEST=Ran ./delta_generator with a cosmos test image creating the diff to
itself.
Change-Id: Id610b03bc22a9ecb1c66d6fdc0548e2657c29f9b
Reviewed-on: https://chromium-review.googlesource.com/266229
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Trybot-Ready: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
1 file changed