On Fri, Feb 01, 2019 at 07:46:56AM -0500, Brian Foster wrote: > Ok, I see. Hmm.. I'm wondering how accurate the ->total value is in the > delalloc conversion path. IIUC, the purpose is to try and select an AG > with enough blocks for the allocation along with the indirect blocks to > insert into the bmbt. Both of those have been reserved at delalloc res > time, hence not needed in the tx. The AG selection code uses the max of > total and the allocation request size, which means that for most > conversions (> maxlevels) total is a no-op. Shouldn't total reflect the > full size of the allocation (alloc size + maxlevels) regardless of > whether the blocks were already "globally reserved?" Note that this is > existing code and probably not something I would change in this series.. I think the total value in this path is completely bogus. A while ago I had a series trying to sort out some of these reservation issues, but it will take a fair amount of work to get back to that.