On Wed, Oct 19, 2016 at 09:48:08AM -0400, Brian Foster wrote: > > if (args->agbp) { > > - if ((error = xfs_alloc_ag_vextent(args))) > > + error = xfs_alloc_ag_vextent(args); > > + if (error) > > goto error0; > > - break; > > + if (args->agbno != NULLAGBLOCK) > > + break; > > + xfs_trans_brelse(args->tp, args->agbp); > > How is this safe with respect to xfs_alloc_fix_freelist() potentially > dirtying the agf? Haven't we had deadlock and/or other problems due to > xfs_alloc_fix_freelist() succeeding when an allocation ultimately fails, > and subsequently rotating to a potentially lower agno? We've had the case where the allocation would fail despite xfs_alloc_fix_freelist succeeding forever, it's just that with discard in general and async discard in particular we can hit it much more easily. The only way to make the allocation no fail if xfs_alloc_fix_freelist succeeded would be to force out any busy extents at the low level if we are tigh on space, I'll have to see how doable that would be. The other option would be to roll around the transaction when switching to a different AG so that we can release the locks. That sounds a lot easier, and also less fragile in the long run. -- To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html