Re: [PATCH 3/3] xfs: work around sparse context tracking in xfs_qm_dquot_isolate

From: Christoph Hellwig
Date: Tue Nov 18 2025 - 01:02:32 EST


On Fri, Nov 14, 2025 at 09:06:23AM -0800, Darrick J. Wong wrote:
> On Fri, Nov 14, 2025 at 06:52:25AM +0100, Christoph Hellwig wrote:
> > sparse gets confused by the goto after spin_trylock:
> >
> > fs/xfs/xfs_qm.c:486:33: warning: context imbalance in 'xfs_qm_dquot_isolate' - different lock contexts for basic block
> >
> > work around this by duplicating the trivial amount of code after the
> > label.
>
> Might want to leave a code comment about shutting up sparse so that
> someone doesn't revert this change to optimize LOC. That said ...
> what is the differing lock context? Does sparse not understand the
> spin_trylock?

So in case that my cover letter wasn't clear enough (or not widely read
:)), I'm somewhat doubtful about wanting to actually merge this upstream.
It just feels wrong to me. But it was the list thing to need a clean
compile, so I wanted to demonstrate it.