On Fri, Apr 26, 2024 at 09:30:05AM +1000, Dave Chinner wrote: > ASSERT(xfs_verify_agbno(args->pag, acur->rec_bno + acur->rec_len)); > > or: > > ASSERT(xfs_verify_agbext(args->pag, acur->rec_bno, acur->rec_len)); > > The latter is better, as it verifies both the start and the end of > the extent are within the bounds of the AG and catches overflows... Yupp. That's what I mean with my original comment - once you start thinking a little bigger there is usually a much better option than these __maybe_unused hacks. Using perag fields and helpers instead of raw buffer access would also benefit a few other places in the allocator as well.