Commit 6aac7705 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Carlos Maiolino
Browse files

xfs: support lowmode allocations in xfs_bmap_exact_minlen_extent_alloc



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: default avatarChristoph Hellwig <hch@lst.de>
Reviewed-by: default avatarDarrick J. Wong <djwong@kernel.org>
Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
parent 405ee87c
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -3501,7 +3501,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);
}

/*