public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bernard Leach <leachbj@bouncycastle.org>
To: linux-kernel@vger.kernel.org
Cc: zippel@linux-m68k.org
Subject: [PATCH] HFSPlus alignment fix
Date: Mon, 16 Feb 2004 22:56:14 +0100	[thread overview]
Message-ID: <1076968573.2097.22.camel@localhost> (raw)


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;



                 reply	other threads:[~2004-02-16 21:16 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1076968573.2097.22.camel@localhost \
    --to=leachbj@bouncycastle.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zippel@linux-m68k.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox