summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2024-09-18 08:30:10 +0300
committerCarlos Maiolino <cem@kernel.org>2024-10-07 09:00:12 +0300
commit6aac77059881e4419df499392c995bf02fb9630b (patch)
treeb7eb8cd21d72ef2112d00fb4a84c0b96f3e197ed
parent405ee87c6938f67e6ab62a3f8f85b3c60a093886 (diff)
downloadlinux-6aac77059881e4419df499392c995bf02fb9630b.tar.xz
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 <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Carlos Maiolino <cem@kernel.org>
-rw-r--r--fs/xfs/libxfs/xfs_bmap.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index 756faae9ba63..36dd08d13293 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -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);
}
/*