From 83b2568b12e27c0032f97f5e52fe9e683069dcb0 Mon Sep 17 00:00:00 2001 From: Patrick Rouleau Date: Sat, 12 Jul 2014 15:53:13 -0400 Subject: [PATCH] Fix validation of image without checksums 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 --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.c b/src/main.c index 903309d3..fc92a68e 100644 --- a/src/main.c +++ b/src/main.c @@ -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;