Re: [PATCH 1/5] xfs: use kfree_rcu_mightsleep to free the perag structures

Christoph Hellwig
2024-08-22T03:42:51Z

On Wed, Aug 21, 2024 at 09:19:39AM -0700, Darrick J. Wong wrote:
> I started wondering, have you seen any complaints from might_sleep when
> freeing pags after a failed growfs?

No, why would I? We're not freeing perags with a spinlock held there.

> Then I wondered if growfs_data
> could actually take any locks that would prevent sleeping, which led me
> to another question: why do growfs_{data,log} hold m_growlock but
> growfs_rt doesn't? Is that actually safe?

As far as I can tell growfs_rt is missing a m_growlock critical section
and right now we allow parallel calls to growfs_rt, which could lead
to unexpected results.