From b47c02ed8bbd1623a5db9936b33f6d80306d53b9 Mon Sep 17 00:00:00 2001 From: Ming-Hung Tsai Date: Sat, 27 Feb 2016 01:31:24 +0800 Subject: [PATCH] Show the wanted checksum in bad-superblock-checksum exception --- thin-provisioning/superblock.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/thin-provisioning/superblock.cc b/thin-provisioning/superblock.cc index 9258b53..fb0d17e 100644 --- a/thin-provisioning/superblock.cc +++ b/thin-provisioning/superblock.cc @@ -91,8 +91,11 @@ namespace { superblock_disk const *sbd = reinterpret_cast(raw); crc32c sum(SUPERBLOCK_CSUM_SEED); sum.append(&sbd->flags_, MD_BLOCK_SIZE - sizeof(uint32_t)); - if (sum.get_sum() != to_cpu(sbd->csum_)) - throw checksum_error("bad checksum in superblock"); + if (sum.get_sum() != to_cpu(sbd->csum_)) { + ostringstream out; + out << "bad checksum in superblock, wanted " << sum.get_sum(); + throw checksum_error(out.str()); + } } virtual void prepare(void *raw, block_address location) const {