]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: fix unaligned access in xfs_btree_visit_blocks
authorEric Sandeen <sandeen@sandeen.net>
Wed, 14 Jun 2017 20:47:14 +0000 (15:47 -0500)
committerEric Sandeen <sandeen@redhat.com>
Wed, 14 Jun 2017 20:47:14 +0000 (15:47 -0500)
Source kernel commit: a4d768e702de224cc85e0c8eac9311763403b368

This structure copy was throwing unaligned access warnings on sparc64:

Kernel unaligned access at TPC[1043c088] xfs_btree_visit_blocks+0x88/0xe0 [xfs]

xfs_btree_copy_ptrs does a memcpy, which avoids it.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_btree.c

index a9e1fa805a84086d225fbafb8b8b17583e067ecd..33bf0dbe8ad129ce4fee84287d6daa64c401a833 100644 (file)
@@ -4395,7 +4395,7 @@ xfs_btree_visit_blocks(
                        xfs_btree_readahead_ptr(cur, ptr, 1);
 
                        /* save for the next iteration of the loop */
-                       lptr = *ptr;
+                       xfs_btree_copy_ptrs(cur, &lptr, ptr, 1);
                }
 
                /* for each buffer in the level */