btrfs-progs: fix unaligned loads in receive
authorZach Brown <zab@zabbo.net>
Thu, 21 Aug 2014 21:24:04 +0000 (14:24 -0700)
committerDavid Sterba <dsterba@suse.cz>
Fri, 22 Aug 2014 14:09:55 +0000 (16:09 +0200)
commitdace60fc82c10f746a6db89885ef02485fbaaba1
tree2e51404f1bf8a78edb164c62f9a90349f42c33a0
parent3db4c0a3d35dd5f81a4c1d405ef7f3ca3357ae03
btrfs-progs: fix unaligned loads in receive

A user reported corruption after receiving subvolumes.  Turning up the
logging during the receive showed that the commands and string
attributes were being received correctly but the u64 attrbutes were
sometimes corrupted by having variable number of low order bytes
introduced.

It turned out they were on a platform that corrupts unaligned userspace
loads.  Loading the u64s from the unaligned pointers into the received
command stream with get_unaligned() fixed the problem.

Reported-By: Klaus Holler <kho@gmx.at>
Tested-By: Klaus Holler <kho@gmx.at>
Signed-off-by: Zach Brown <zab@zabbo.net>
Signed-off-by: David Sterba <dsterba@suse.cz>
send-stream.c