From 8871a0eaa98d951727e97c615d831af9a60432ae Mon Sep 17 00:00:00 2001 From: David Miller Date: Fri, 15 Feb 2008 11:19:58 -0500 Subject: Unaligned access fixes The first problem is that these SETGET macros lose typing information, and therefore can't see the 'packed' attribute and therefore take unaligned access SIGBUS signals on sparc64 when trying to derefernce the member. The next problem is a similar issue in btrfs_name_hash(). This gets passed things like &key.offset which is a member of a packed structure, losing this packed'ness information btrfs_name_hash() performs a potentially unaligned memory access, again resulting in a SIGBUS. --- hasher.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'hasher.c') diff --git a/hasher.c b/hasher.c index fb4b0a5e..b80407cf 100644 --- a/hasher.c +++ b/hasher.c @@ -35,8 +35,7 @@ int main() { continue; if (line[strlen(line)-1] == '\n') line[strlen(line)-1] = '\0'; - ret = btrfs_name_hash(line, strlen(line), &result); - BUG_ON(ret); + result = btrfs_name_hash(line, strlen(line)); printf("hash returns %llu\n", (unsigned long long)result); } return 0; -- cgit v1.2.3