]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
libxfs: pack the agfl header structure so XFS_AGFL_SIZE is correct
authorDarrick J. Wong <darrick.wong@oracle.com>
Sun, 20 Dec 2015 23:54:40 +0000 (10:54 +1100)
committerDave Chinner <david@fromorbit.com>
Sun, 20 Dec 2015 23:54:40 +0000 (10:54 +1100)
commit9fccb9f6deaacab250653dc1ccf7099c58e999a9
treedf7fbcbfa8d705f7af66cfb1d71e209e04fa5f92
parent36e8786d1f9bfd16ae1654d1093de233f4c39396
libxfs: pack the agfl header structure so XFS_AGFL_SIZE is correct

Because struct xfs_agfl is 36 bytes long and has a 64-bit integer
inside it, gcc will quietly round the structure size up to the nearest
64 bits -- in this case, 40 bytes.  This results in the XFS_AGFL_SIZE
macro returning incorrect results for v5 filesystems on 64-bit
machines (118 items instead of 119).  As a result, a 32-bit xfs_repair
will see garbage in AGFL item 119 and complain.

Therefore, tell gcc not to pad the structure so that the AGFL size
calculation is correct.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
libxfs/xfs_format.h