]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: xfs_rtword_t should be unsigned, not signed
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 28 Jun 2018 20:11:57 +0000 (15:11 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 28 Jun 2018 20:11:57 +0000 (15:11 -0500)
commita531149e9b6f9b5e481e0fe97438316fd978ebc4
tree162add0a97187f20e2912b3876a71b9a2eaaa5e5
parentb153fb40c81b5f1a56d160666b8123264e6ba129
xfs: xfs_rtword_t should be unsigned, not signed

Source kernel commit: 2483113f3d7baa303deac115e6764d9489c8316b

xfs_rtword_t is used for bit manipulations in the realtime bitmap file.
Since we're performing bit shifts with this type, we don't want sign
extension and we don't want to be left shifting negative quantities
because that's undefined behavior.

This also shuts up these UBSAN warnings:
UBSAN: Undefined behaviour in fs/xfs/libxfs/xfs_rtbitmap.c:833:48
signed integer overflow:
-2147483648 - 1 cannot be represented in type 'int'

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Allison Henderson <allison.henderson@oracle.com>
Reviewed-by: Bill O'Donnell <billodo@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_types.h