HFSPlus alignment fix
PATCH 1/1 HFSPlus alignment fix
Below is a patch against 2.4.24 that fixes an alignment issue in the HFS+ filesystem.
The fix originates from Daniel Hazelbaker <cabal95 (at) users.sourceforge.net>.
cheers,
bern.
hfsplus/wrapper.c 4 Feb 2004 13:58:20 -0000 1.2 renamed from hfsplus/wrapper.c 4 Feb 2004 13:27:38 -0000 1.1.1.1 +1 -0
@@ -14,6 +14,7 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) #include <linux/buffer_head.h> #endif +#include <asm/unaligned.h> #include "hfsplus_fs.h" #include "hfsplus_raw.h"
@@ -45,7 +46,7 @@ return 0; wd->ablk_start = be16_to_cpu(*(u16 *)(bufptr +
HFSP_WRAPOFF_ABLKSTART));
- extent = be32_to_cpu(*(u32 *)(bufptr + HFSP_WRAPOFF_EMBEDEXT));
+ extent = be32_to_cpu(get_unaligned((u32 *)(bufptr +
HFSP_WRAPOFF_EMBEDEXT)));
wd->embed_start = (extent >> 16) & 0xFFFF;
wd->embed_count = extent & 0xFFFF;