From: Dave Chinner Date: Wed, 4 Sep 2013 22:05:08 +0000 (+0000) Subject: libxfs: fix directory/attribute format issues X-Git-Tag: v3.2.0-alpha1~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84796a146ce8b711ba596303e41002dc7720c976;p=thirdparty%2Fxfsprogs-dev.git libxfs: fix directory/attribute format issues directory data headers and attr leaf headers need padding for 32 bit systems to correctly align the data sections on 64 bit boundaries. Signed-off-by: Dave Chinner Review-by: Mark Tinguely Signed-off-by: Rich Johnston --- diff --git a/include/xfs_attr_leaf.h b/include/xfs_attr_leaf.h index b3e93bb01..c1022138c 100644 --- a/include/xfs_attr_leaf.h +++ b/include/xfs_attr_leaf.h @@ -128,6 +128,7 @@ struct xfs_attr3_leaf_hdr { __u8 holes; __u8 pad1; struct xfs_attr_leaf_map freemap[XFS_ATTR_LEAF_MAPSIZE]; + __be32 pad2; /* 64 bit alignment */ }; #define XFS_ATTR3_LEAF_CRC_OFF (offsetof(struct xfs_attr3_leaf_hdr, info.crc)) diff --git a/include/xfs_dir2_format.h b/include/xfs_dir2_format.h index 8c16bb07d..4126e86a4 100644 --- a/include/xfs_dir2_format.h +++ b/include/xfs_dir2_format.h @@ -260,6 +260,7 @@ struct xfs_dir3_blk_hdr { struct xfs_dir3_data_hdr { struct xfs_dir3_blk_hdr hdr; xfs_dir2_data_free_t best_free[XFS_DIR2_DATA_FD_COUNT]; + __be32 pad; /* 64 bit alignment */ }; #define XFS_DIR3_DATA_CRC_OFF offsetof(struct xfs_dir3_data_hdr, hdr.crc) @@ -471,7 +472,7 @@ struct xfs_dir3_leaf_hdr { struct xfs_da3_blkinfo info; /* header for da routines */ __be16 count; /* count of entries */ __be16 stale; /* count of stale entries */ - __be32 pad; + __be32 pad; /* 64 bit alignment */ }; struct xfs_dir3_icleaf_hdr { @@ -712,7 +713,7 @@ struct xfs_dir3_free_hdr { __be32 firstdb; /* db of first entry */ __be32 nvalid; /* count of valid entries */ __be32 nused; /* count of used entries */ - __be32 pad; /* 64 bit alignment. */ + __be32 pad; /* 64 bit alignment */ }; struct xfs_dir3_free {