From: Christoph Hellwig Date: Mon, 21 Oct 2024 00:10:48 +0000 (-0700) Subject: xfs: support lowmode allocations in xfs_bmap_exact_minlen_extent_alloc X-Git-Tag: v6.12.0~34 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=43f4e9bef3f5dc5e9c3d55ca30c33233d54b8ed7;p=thirdparty%2Fxfsprogs-dev.git xfs: support lowmode allocations in xfs_bmap_exact_minlen_extent_alloc Source kernel commit: 6aac77059881e4419df499392c995bf02fb9630b Currently the debug-only xfs_bmap_exact_minlen_extent_alloc allocation variant fails to drop into the lowmode last resort allocator, and thus can sometimes fail allocations for which the caller has a transaction block reservation. Fix this by using xfs_bmap_btalloc_low_space to do the actual allocation. Signed-off-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Carlos Maiolino --- diff --git a/libxfs/xfs_bmap.c b/libxfs/xfs_bmap.c index 02f26854..aec378ff 100644 --- a/libxfs/xfs_bmap.c +++ b/libxfs/xfs_bmap.c @@ -3495,7 +3495,13 @@ xfs_bmap_exact_minlen_extent_alloc( */ ap->blkno = XFS_AGB_TO_FSB(ap->ip->i_mount, 0, 0); - return xfs_alloc_vextent_first_ag(args, ap->blkno); + /* + * Call xfs_bmap_btalloc_low_space here as it first does a "normal" AG + * iteration and then drops args->total to args->minlen, which might be + * required to find an allocation for the transaction reservation when + * the file system is very full. + */ + return xfs_bmap_btalloc_low_space(ap, args); } /*