]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_spaceman: handle internal RT devices
authorChristoph Hellwig <hch@lst.de>
Mon, 14 Apr 2025 05:36:23 +0000 (07:36 +0200)
committerAndrey Albershteyn <aalbersh@kernel.org>
Tue, 29 Apr 2025 16:11:09 +0000 (18:11 +0200)
Handle the synthetic fmr_device values for fsmap.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
spaceman/freesp.c

index dfbec52a716035d057a55ce0be4a70ad05e74689..9ad321c4843f5991b45547f9a929b53ef6c263bf 100644 (file)
@@ -140,12 +140,19 @@ scan_ag(
        if (agno != NULLAGNUMBER) {
                l->fmr_physical = cvt_agbno_to_b(xfd, agno, 0);
                h->fmr_physical = cvt_agbno_to_b(xfd, agno + 1, 0);
-               l->fmr_device = h->fmr_device = file->fs_path.fs_datadev;
+               if (file->xfd.fsgeom.rtstart)
+                       l->fmr_device = XFS_DEV_DATA;
+               else
+                       l->fmr_device = file->fs_path.fs_datadev;
        } else {
                l->fmr_physical = 0;
                h->fmr_physical = ULLONG_MAX;
-               l->fmr_device = h->fmr_device = file->fs_path.fs_rtdev;
+               if (file->xfd.fsgeom.rtstart)
+                       l->fmr_device = XFS_DEV_RT;
+               else
+                       l->fmr_device = file->fs_path.fs_rtdev;
        }
+               h->fmr_device = l->fmr_device;
        h->fmr_owner = ULLONG_MAX;
        h->fmr_flags = UINT_MAX;
        h->fmr_offset = ULLONG_MAX;