]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs_scrub: fix broken realtime free blocks unit conversions
authorDarrick J. Wong <djwong@kernel.org>
Thu, 16 Feb 2023 21:52:58 +0000 (13:52 -0800)
committerCarlos Maiolino <cem@kernel.org>
Thu, 23 Feb 2023 08:54:27 +0000 (09:54 +0100)
commit085fce0ba2e7222e943b1c756c03de84639361b8
tree986f67a19d55850ca36ec80598e76ad5897371be
parent5a77e0e7c57e8c0a5e7e6877a2612d60b5805f44
xfs_scrub: fix broken realtime free blocks unit conversions

r_blocks is in units of fs blocks, but freertx is in units of realtime
extents.  Add the missing conversion factor so we don't end up with
bogus things like this:

Pretend that sda and sdb are both 100T volumes.

# mkfs.xfs -f /dev/sda -b -r rtdev=/dev/sdb,extsize=2m
# mount /dev/sda /mnt -o rtdev=/dev/sdb
# xfs_scrub -dTvn /mnt
<snip>
Phase 7: Check summary counters.
3.5TiB data used;  99.8TiB realtime data used;  55 inodes used.
2.0GiB data found; 50.0MiB realtime data found; 55 inodes found.
55 inodes counted; 0 inodes checked.

We just created the filesystem, the realtime volume should be empty.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
scrub/fscounters.c