]> www.infradead.org Git - users/hch/xfsprogs.git/commit
xfs_db: Interpret inode's di_format field as unsigned
authorchandan <chandan@linux.vnet.ibm.com>
Thu, 26 Jan 2017 02:02:43 +0000 (20:02 -0600)
committerEric Sandeen <sandeen@redhat.com>
Thu, 26 Jan 2017 02:02:43 +0000 (20:02 -0600)
commit47dd674372891cf2e5cc7d0bbba3e648653a235e
tree850466285fe541313a0614c794146752d9066883
parentce746a2928d43face98cdb6684dea343b8e9b481
xfs_db: Interpret inode's di_format field as unsigned

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>
db/inode.c