]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs_db: create separate struct and field definitions for finobts
authorDarrick J. Wong <djwong@kernel.org>
Tue, 13 Dec 2022 19:39:48 +0000 (11:39 -0800)
committerCarlos Maiolino <cem@kernel.org>
Thu, 15 Dec 2022 05:57:19 +0000 (06:57 +0100)
commite229a59f010b7f8544f9350987fff5e86d06dfcf
tree26c2ed38888d0dcd069d73100c9f4b5384cf23a3
parentf6fb1c078f00c6dd54d4dfdf187a2b5fcc6ec09c
xfs_db: create separate struct and field definitions for finobts

Create separate field_t definitions for the free inode btree because db
needs to know that the interior block pointers point to finobt blocks,
not inobt blocks.  This is critical now because the buffer ops contain
magic numbers, the ->verify_struct routines use the magics listed in the
buffer ops, and the xfs_db iocursor calls the verifier functions.

Without this patch, xfs_db emits bizarre output like this:

# xfs_db -x /dev/sde -c 'agi 1' -c 'addr free_root' -c 'addr ptrs[1]' -c print 2>&1 | head
Metadata corruption detected at 0x55dda21258b0, xfs_inobt block 0x275c20/0x1000
magic = 0x46494233

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
db/btblock.c
db/btblock.h
db/field.c
db/field.h
db/type.c