aboutsummaryrefslogtreecommitdiffstats
path: root/dir-test.c
diff options
context:
space:
mode:
authorDavid Miller <davem@davemloft.net>2008-02-15 11:19:58 -0500
committerDavid Woodhouse <dwmw2@hera.kernel.org>2008-02-15 11:19:58 -0500
commit8871a0eaa98d951727e97c615d831af9a60432ae (patch)
tree7701fa42a830e2fba095199bfe25c62b42b9d36e /dir-test.c
parent0c6513b1d120ba99a3d5f3641cb059723245ec00 (diff)
downloadbtrfs-progs-8871a0eaa98d951727e97c615d831af9a60432ae.tar.gz
btrfs-progs-8871a0eaa98d951727e97c615d831af9a60432ae.tar.xz
btrfs-progs-8871a0eaa98d951727e97c615d831af9a60432ae.zip
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.
Diffstat (limited to 'dir-test.c')
-rw-r--r--dir-test.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dir-test.c b/dir-test.c
index dc024a2..54ddee2 100644
--- a/dir-test.c
+++ b/dir-test.c
@@ -129,8 +129,8 @@ error:
struct btrfs_dir_item);
found = (char *)(di + 1);
found_len = btrfs_dir_name_len(di);
- btrfs_name_hash(buf, strlen(buf), &myhash);
- btrfs_name_hash(found, found_len, &foundhash);
+ myhash = btrfs_name_hash(buf, strlen(buf));
+ foundhash = btrfs_name_hash(found, found_len);
if (myhash != foundhash)
goto fatal_release;
btrfs_release_path(root, &path);