From: Darrick J. Wong Date: Thu, 18 Aug 2016 23:20:46 +0000 (+1000) Subject: libxfs: fix xfs_isset pointer calculation X-Git-Tag: v4.8.0-rc1~53 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=de2f203d2bcdd29570f74ea164241e0791389494;p=thirdparty%2Fxfsprogs-dev.git libxfs: fix xfs_isset pointer calculation In the macro xfs_isset, the variable 'a' is a pointer to an array type. However, the bit offset calculation uses sizeof(a), which returns the size of the pointer, not the size of an array element. Fix this, which also fixes the problem where xfs_check spits out bogus "rtblock X expected type unknown, got rtfree" messages. Signed-off-by: Darrick J. Wong Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- diff --git a/include/libxfs.h b/include/libxfs.h index c182fa159..1e6d1d3a7 100644 --- a/include/libxfs.h +++ b/include/libxfs.h @@ -87,7 +87,7 @@ extern uint32_t crc32c_le(uint32_t crc, unsigned char const *p, size_t len); #define XFS_SUPER_MAGIC 0x58465342 #endif -#define xfs_isset(a,i) ((a)[(i)/(sizeof((a))*NBBY)] & (1<<((i)%(sizeof((a))*NBBY)))) +#define xfs_isset(a,i) ((a)[(i)/(sizeof(*(a))*NBBY)] & (1ULL<<((i)%(sizeof(*(a))*NBBY)))) /* * Argument structure for libxfs_init().