]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_db: print freecount in xfs_inobt_rec as unsigned
authorEric Sandeen <sandeen@redhat.com>
Tue, 30 Oct 2018 21:51:59 +0000 (16:51 -0500)
committerEric Sandeen <sandeen@redhat.com>
Tue, 30 Oct 2018 21:51:59 +0000 (16:51 -0500)
"freecount" in the xfs_inobt_rec is unsigned, so xfs_db should
print it as such.

Not doing so tickles a bug in getbitval() where we try to handle
sign extension for signed fields and fail badly on big endian
machines, causing us to incorrectly report negative numbers when
printing structures even when the number is nowhere near the
signed maximum value.

So this fix works around that bug by properly marking this field
as unsigned, because I have yet to convince myself of the proper
fix for the underlying bug.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=201453
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
db/btblock.c

index af42bf73a9d1e783abbe0e0f946f84c43f87351d..e57d5f466951b41f0197910dcc36ce675f6d957c 100644 (file)
@@ -513,7 +513,7 @@ const field_t       inobt_sprec_flds[] = {
        { "holemask", FLDT_UINT16X, OI(ROFF(ir_u.sp.ir_holemask)), C1, 0,
          TYP_NONE },
        { "count", FLDT_UINT8D, OI(ROFF(ir_u.sp.ir_count)), C1, 0, TYP_NONE },
-       { "freecount", FLDT_INT8D, OI(ROFF(ir_u.sp.ir_freecount)), C1, 0,
+       { "freecount", FLDT_UINT8D, OI(ROFF(ir_u.sp.ir_freecount)), C1, 0,
          TYP_NONE },
        { "free", FLDT_INOFREE, OI(ROFF(ir_free)), C1, 0, TYP_NONE },
        { NULL }