On Thu, Sep 19, 2024 at 11:09:40AM +1000, Dave Chinner wrote: > Ideally, we should not be using the new AGs until *after* the growfs > transaction has hit stable storage (i.e. the journal has fully > commmitted the growfs transaction), not just committed to the CIL. Yes. A crude version of that - freeze/unfreeze before setting the AG live was my other initial idea, but Darrick wasn't exactly excited about that.. > The second step is preventing allocations that are running from > seeing the mp->m_sb.sb_agcount update until after the transaction is > stable. Or just not seeing the pag as active by not setting the initial active reference until after the transaction is stable. Given all the issues outlined by you about sb locking that might be the easier approach.