]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs_db: don't hardcode 'type data' size at 512b
authorDarrick J. Wong <djwong@kernel.org>
Thu, 22 Feb 2024 22:04:31 +0000 (14:04 -0800)
committerCarlos Maiolino <cem@kernel.org>
Tue, 12 Mar 2024 14:36:32 +0000 (15:36 +0100)
commit127b66a4d8afc6f3dfe8929c01b1f1e63c1ebf31
treeaca85cf637979c4db7c17ae80b9844dd666428c6
parent86f3757ae033c07f8e90df2526e2f62144805ef5
xfs_db: don't hardcode 'type data' size at 512b

On a disk with 4096-byte LBAs, the xfs_db 'type data' subcommand doesn't
work:

# xfs_io -c 'sb' -c 'type data' /dev/sda
xfs_db: read failed: Invalid argument
no current object

The cause of this is the hardcoded initialization of bb_count when we're
setting type data -- it should be the filesystem sector size, not just 1.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
db/block.c
db/io.c