]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
libxfs: fix xfs_isset pointer calculation
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 18 Aug 2016 23:20:46 +0000 (09:20 +1000)
committerDave Chinner <david@fromorbit.com>
Thu, 18 Aug 2016 23:20:46 +0000 (09:20 +1000)
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 <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
include/libxfs.h

index c182fa159ca0720ef930aa3becfdcf392c82e90b..1e6d1d3a77bbc284974d87df242aa1f4827c2764 100644 (file)
@@ -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().