On a ppc64 big endian system, xfs_db would print the following,
xfs_db> p
core.magic = 0x494e
core.mode =
0100600
core.version = 3
core.format = -253
This is due to fp_dinode_fmt() interpretting the di_format field as
signed. This commit fixes the bug by passing BVUNSIGNED (instead of
BVSIGNED) as the argument to getbitval(). With this commit applied, we
now get,
xfs_db> p
core.magic = 0x494e
core.mode =
0100600
core.version = 3
core.format = 3 (btree)
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
int i;
for (i = 0, bitpos = bit; i < count; i++, bitpos += size) {
- f = (xfs_dinode_fmt_t)getbitval(obj, bitpos, size, BVSIGNED);
+ f = (xfs_dinode_fmt_t)getbitval(obj, bitpos, size, BVUNSIGNED);
if (array)
dbprintf("%d:", i + base);
if (f < 0 || f >= dinode_fmt_name_size)