Re: [PATCH 09/13] xfs: support RT inodes in xfs_mod_delalloc

Dave Chinner
2024-03-28T04:42:22Z

On Thu, Mar 28, 2024 at 05:34:11AM +0100, Christoph Hellwig wrote:
> On Thu, Mar 28, 2024 at 03:27:36PM +1100, Dave Chinner wrote:
> > > percpu_counter_set(&mp->m_fdblocks, fsc->fdblocks);
> > > - percpu_counter_set(&mp->m_frextents, fsc->frextents);
> > > + percpu_counter_set(&mp->m_frextents,
> > > + fsc->frextents - fsc->frextents_delayed);
> > > mp->m_sb.sb_frextents = fsc->frextents;
> >
> > Why do we set mp->m_frextents differently to mp->m_fdblocks?
> > Surely if we have to care about delalloc blocks here, we have to
> > process both data device and rt device delalloc block accounting the
> > same way, right?
>
> Unfortunately there are different. For data device blocks we use the
> lazy sb counters and thus never updated the sb version for any file
> system new enough to support scrub. For RT extents lazy sb counters
> only appear half way down Darrick's giant stack and aren't even
> upstream yet.

Can you add a comment to either the code or commit message to that
effect? Otherwise I'm going to forget about that and not be able to
discover it from looking at the code and/or commit messages...

With such a comment, you can also add

Reviewed-by: Dave Chinner <dchinner@redhat.com>

-Dave.
--
Dave Chinner
david@fromorbit.com