[PATCH] HFSPlus alignment fix
From: Bernard Leach
Date: Mon Feb 16 2004 - 16:17:45 EST
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.
--- fs/hfsplus/wrapper.c 4 Feb 2004 13:27:38 -0000 1.1.1.1
+++ fs/hfsplus/wrapper.c 4 Feb 2004 13:58:20 -0000 1.2
@@ -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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/