From: Keith Owens Date: Mon, 15 Oct 2001 07:10:41 +0000 (+0000) Subject: Remove IA64 unlaigned accesses in xfs_repair X-Git-Tag: v2.0.0~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fdec5ea9e14c7159491ae160900e7b3b2aa4e09c;p=thirdparty%2Fxfsprogs-dev.git Remove IA64 unlaigned accesses in xfs_repair --- diff --git a/include/libxfs.h b/include/libxfs.h index a01b3b19f..93ba22293 100644 --- a/include/libxfs.h +++ b/include/libxfs.h @@ -425,7 +425,7 @@ extern int libxfs_attr_leaf_newentsize (xfs_da_args_t *, int, int *); extern xfs_filblks_t libxfs_bmbt_get_blockcount (xfs_bmbt_rec_t *); extern xfs_fileoff_t libxfs_bmbt_get_startoff (xfs_bmbt_rec_t *); -extern void libxfs_bmbt_get_all (xfs_bmbt_rec_t *, xfs_bmbt_irec_t *); +extern void libxfs_bmbt_get_all (xfs_bmbt_rec_32_t *, xfs_bmbt_irec_t *); extern int libxfs_free_extent (xfs_trans_t *, xfs_fsblock_t, xfs_extlen_t); extern int libxfs_rtfree_extent (xfs_trans_t *, xfs_rtblock_t, diff --git a/libxfs/xfs_bmap_btree.c b/libxfs/xfs_bmap_btree.c index 3fed3a7ff..5948c4af3 100644 --- a/libxfs/xfs_bmap_btree.c +++ b/libxfs/xfs_bmap_btree.c @@ -1552,14 +1552,21 @@ xfs_bmbt_delete( * Convert a compressed bmap extent record to an uncompressed form. * This code must be in sync with the routines xfs_bmbt_get_startoff, * xfs_bmbt_get_startblock, xfs_bmbt_get_blockcount and xfs_bmbt_get_state. + * + * In the kernel this function is called with xfs_bmbt_rec_t, the caller has + * already ensured that the data is suitably aligned. In commands, the data is + * aligned to 32 bit until it gets here so this routine has to convert to the + * machine alignment. This is a divergence between kernel and commands. KAO. */ void xfs_bmbt_get_all( - xfs_bmbt_rec_t *r, + xfs_bmbt_rec_32_t *rp, xfs_bmbt_irec_t *s) { int ext_flag; xfs_exntst_t st; + xfs_bmbt_rec_t rpcopy, *r = &rpcopy; + memcpy(&rpcopy, rp, sizeof(rpcopy)); #if BMBT_USE_64 ext_flag = (int)((INT_GET(r->l0, ARCH_CONVERT)) >> (64 - BMBT_EXNTFLAG_BITLEN)); diff --git a/repair/dinode.c b/repair/dinode.c index 428f40595..520d579b5 100644 --- a/repair/dinode.c +++ b/repair/dinode.c @@ -444,7 +444,7 @@ convert_extent( { xfs_bmbt_irec_t irec, *s = &irec; /* Just use the extent parsing routine from the kernel */ - libxfs_bmbt_get_all((xfs_bmbt_rec_t *)rp, s); + libxfs_bmbt_get_all(rp, s); if (fs_has_extflgbit) { if (s->br_state == XFS_EXT_UNWRITTEN) {