]> git.ipfire.org Git - thirdparty/mdadm.git/commit - util.c
Fix bus error when accessing MBR partition records
authorJames Clarke <jrtc27@jrtc27.com>
Mon, 17 Oct 2016 20:16:01 +0000 (21:16 +0100)
committerJes Sorensen <Jes.Sorensen@redhat.com>
Wed, 19 Oct 2016 16:38:02 +0000 (12:38 -0400)
commit8e2bca513efc5deccb11cb90bad3c0891c4929e3
treeb5ac710fc39b07c3fd6e4d5cc4442c3ba5974495
parent089f9d795e394a11f32d8cab0254df49e9099f63
Fix bus error when accessing MBR partition records

Since the MBR layout only has partition records as 2-byte aligned, the
32-bit fields in them are not aligned. Thus, they cannot be accessed on
some architectures (such as SPARC) by using a "struct MBR_part_record *"
pointer, as the compiler can assume that the pointer is properly aligned.
Instead, the records must be accessed by going through the MBR struct
itself every time.

Signed-off-by: James Clarke <jrtc27@jrtc27.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
part.h
super-mbr.c
util.c