Skip to content

Commit 6aac770

Browse files
Christoph Hellwigcmaiolino
authored andcommitted
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: Christoph Hellwig <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Signed-off-by: Carlos Maiolino <[email protected]>
1 parent 405ee87 commit 6aac770

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

fs/xfs/libxfs/xfs_bmap.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3501,7 +3501,13 @@ xfs_bmap_exact_minlen_extent_alloc(
35013501
*/
35023502
ap->blkno = XFS_AGB_TO_FSB(ap->ip->i_mount, 0, 0);
35033503

3504-
return xfs_alloc_vextent_first_ag(args, ap->blkno);
3504+
/*
3505+
* Call xfs_bmap_btalloc_low_space here as it first does a "normal" AG
3506+
* iteration and then drops args->total to args->minlen, which might be
3507+
* required to find an allocation for the transaction reservation when
3508+
* the file system is very full.
3509+
*/
3510+
return xfs_bmap_btalloc_low_space(ap, args);
35053511
}
35063512

35073513
/*

0 commit comments

Comments
 (0)