]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_db: fix finobt record decoding when sparse inodes enabled
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 28 Jan 2019 19:03:15 +0000 (13:03 -0600)
committerEric Sandeen <sandeen@redhat.com>
Mon, 28 Jan 2019 19:03:15 +0000 (13:03 -0600)
Use the sparse inobt record field decoder (inobt_spcrc_hfld) to decode
finobt records when sparse inodes are enabled.  Otherwise, xfs_db
prints out bogus things like:

recs[1] = [startino,freecount,free]
1:[214720,16429,0xfffffffffff80000]

There can never be 16429 records in an inode btree record; instead it
should print:

recs[1] = [startino,holemask,count,freecount,free]
1:[214720,0,64,45,0xfffffffffff80000]

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
db/type.c

index d0234c5799cdbb783bd70f35fc0fee0c55607b2e..f5f65042c878c6f72f623d0ae31d2bf3afcb7f94 100644 (file)
--- a/db/type.c
+++ b/db/type.c
@@ -151,7 +151,7 @@ static const typ_t  __typtab_spcrc[] = {
        { TYP_SYMLINK, "symlink", handle_struct, symlink_crc_hfld,
                &xfs_symlink_buf_ops, XFS_SYMLINK_CRC_OFF },
        { TYP_TEXT, "text", handle_text, NULL, NULL, TYP_F_NO_CRC_OFF },
-       { TYP_FINOBT, "finobt", handle_struct, inobt_crc_hfld,
+       { TYP_FINOBT, "finobt", handle_struct, inobt_spcrc_hfld,
                &xfs_inobt_buf_ops, XFS_BTREE_SBLOCK_CRC_OFF },
        { TYP_NONE, NULL }
 };