[Bugs] [Bug 1448299] Mismatch in checksum of the image file after copying to a new image file

bugzilla at redhat.com bugzilla at redhat.com
Fri May 5 06:50:41 UTC 2017


https://bugzilla.redhat.com/show_bug.cgi?id=1448299



--- Comment #1 from Krutika Dhananjay <kdhananj at redhat.com> ---
The issue is size mismatch between the src and dst file upon `cp` where the dst
file is on gluster mount and sharded, leading to checksum mismatch. This
particular bug is in shard's aggregated size accounting and is exposed when
there are parallel writes and extending truncate on the file.
And `cp` does a truncate on the dst file before writing to it. The
parallelization comes in when write-behind flushes cached writes and an
extending truncate in parallel.

Note that the data integrity of the vm image is *not* affected by this bug.
What is affected is the size of the file.
To confirm this, I truncated the extra bytes off the dst file to make its size
same as size of src file and computed checksum again.
In this case checksums did match. I asked Satheesaran also to verify the same
and he confirmed it works.
Basically md5sum,sha256sum etc fetch file size and read till the end of the
file size. So in the dst file, the excess portion is filled with zeroes and
checksum calculated on this region too.

FWIW, the same checksum test exists in upstream master regression test suite -
https://github.com/gluster/glusterfs/blob/master/tests/bugs/shard/bug-1272986.t.
The reason it passes there consistently is because the script performs copy
through `dd` as opposed to `cp`.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are on the CC list for the bug.


More information about the Bugs mailing list