diff options
author | James Clarke <jrtc27@jrtc27.com> | 2016-10-17 22:16:01 +0200 |
---|---|---|
committer | Jes Sorensen <Jes.Sorensen@redhat.com> | 2016-10-19 18:38:02 +0200 |
commit | 8e2bca513efc5deccb11cb90bad3c0891c4929e3 (patch) | |
tree | b5ac710fc39b07c3fd6e4d5cc4442c3ba5974495 /part.h | |
parent | super-intel: Reduce excessive parenthesis abuse (diff) | |
download | mdadm-8e2bca513efc5deccb11cb90bad3c0891c4929e3.tar.xz mdadm-8e2bca513efc5deccb11cb90bad3c0891c4929e3.zip |
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>
Diffstat (limited to 'part.h')
-rw-r--r-- | part.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -40,7 +40,7 @@ struct MBR_part_record { __u8 last_cyl; __u32 first_sect_lba; __u32 blocks_num; -}; +} __attribute__((packed)); struct MBR { __u8 pad[446]; |