Skip to content

Commit

Permalink
Fix validation of image without checksums
Browse files Browse the repository at this point in the history
When the image does not use a checksum, it is validated with custom code.
Some file systems do not report the same used block count than what partclone
find while he build the used bitmap. We must use the count from the bitmap
because the clone and restore are based solely on the bitmap.

Signed-off-by: Patrick Rouleau <[email protected]>
  • Loading branch information
pfrouleau committed Jul 12, 2014
1 parent 834105b commit 83b2568
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ int main(int argc, char **argv) {
} else if (opt.chkimg && img_opt.checksum_mode == CSM_NONE
&& strcmp(opt.source, "-") != 0) {

unsigned long long total_offset = (fs_info.usedblocks - 1) * fs_info.block_size;
unsigned long long total_offset = (fs_info.used_bitmap - 1) * fs_info.block_size;
char last_block[fs_info.block_size];
off_t partial_offset = INT32_MAX;

Expand Down

0 comments on commit 83b2568

Please sign in to comment.