Re: [PATCH 30/43] xfs: hide reserved RT blocks from statfs

Christoph Hellwig
2024-12-15T06:03:23Z

On Fri, Dec 13, 2024 at 02:43:58PM -0800, Darrick J. Wong wrote:
> > - st->f_blocks = mp->m_sb.sb_rblocks;
> > + st->f_blocks = mp->m_sb.sb_rblocks -
> > + xfs_rtbxlen_to_blen(mp, mp->m_resblks[XC_FREE_RTEXTENTS].total);
>
> I wonder, is mp->m_resblks[XC_FREE_RTEXTENTS].total considered
> "unavailable"? Should that be added to xfs_freecounter_unavailable?

That messed up the set_aside calculation in xfs_dec_freecounter and
I think also xfs_reserve_blocks. I tried this early on in the project
and it made a complete mess of the free block accounting.