If we have too many busy extents, or just enough to make our wanted allocation impossible we will never move on to another AG in xfs_alloc_vextent currently. Change the loop exit condition to keep looking for an AG if we can't allocate an extent. For the single AG cases we don't need to change anything as the higher layers need to handle this case. Signed-off-by: Christoph Hellwig <hch@xxxxxx> --- fs/xfs/libxfs/xfs_alloc.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/xfs/libxfs/xfs_alloc.c b/fs/xfs/libxfs/xfs_alloc.c index effb64c..0a04bec 100644 --- a/fs/xfs/libxfs/xfs_alloc.c +++ b/fs/xfs/libxfs/xfs_alloc.c @@ -2753,13 +2753,18 @@ xfs_alloc_vextent( trace_xfs_alloc_vextent_nofix(args); goto error0; } + /* - * If we get a buffer back then the allocation will fly. + * If we get a buffer back then the allocation will fly, + * unless there are busy extents in the way. */ 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); } trace_xfs_alloc_vextent_loopfailed(args); -- 2.1.4 -- 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