Re: [PATCH 35/43] xfs: enable fsmap reporting for internal RT devices

Christoph Hellwig
2024-12-15T06:26:17Z

On Fri, Dec 13, 2024 at 03:11:15PM -0800, Darrick J. Wong wrote:
> > + /* Fabricate an rmap entry for space occupied by the data dev */
> > + error = xfs_getfsmap_helper(tp, info, &frec);
> > + if (error)
> > + return error;
>
> Seeing as you report different fmr_device values for the data and rt
> devices, I'd have though that you'd want the rt fsmappings to start at
> fmr_physical == 0. But then I guess for the sb_rtstart > 0 case, the
> rtblock values that get written into the bmbt have that rtstart value
> added in, don't they?

The bmbt values are all relative to rtstart, the daddr translation is what
adds the offset. So if we want to take the offset out of the fsmap
reporting, I'll need new helpers to not add it or manually subtract it
afterwards. If that's preferred it should be doable, even if the fsmap
code keeps confusing me more each time I look at it.