public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Chandan Babu R <chandan.babu@oracle.com>
Cc: "Darrick J. Wong" <djwong@kernel.org>, linux-xfs@vger.kernel.org
Subject: [PATCH 6/6] xfs: support lowmode allocations in xfs_bmap_exact_minlen_extent_alloc
Date: Tue, 20 Aug 2024 19:04:57 +0200	[thread overview]
Message-ID: <20240820170517.528181-7-hch@lst.de> (raw)
In-Reply-To: <20240820170517.528181-1-hch@lst.de>

Currently the debug-only xfs_bmap_exact_minlen_extent_alloc allocation
variant fails to drop into the lowmode last restor 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>
---
 fs/xfs/libxfs/xfs_bmap.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/libxfs/xfs_bmap.c b/fs/xfs/libxfs/xfs_bmap.c
index b5eeaea164ee46..784dd5dda2a1a2 100644
--- a/fs/xfs/libxfs/xfs_bmap.c
+++ b/fs/xfs/libxfs/xfs_bmap.c
@@ -3493,7 +3493,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);
+	/*
+	 * Use the low space allocator as it first does a "normal" AG iteration
+	 * and then drops the reservation to 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);
 }
 #else
 
-- 
2.43.0


  parent reply	other threads:[~2024-08-20 17:05 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-20 17:04 fix a DEBUG-only assert failure in xfs/538 Christoph Hellwig
2024-08-20 17:04 ` [PATCH 1/6] xfs: merge xfs_attr_leaf_try_add into xfs_attr_leaf_addname Christoph Hellwig
2024-08-21 15:52   ` Darrick J. Wong
2024-08-20 17:04 ` [PATCH 2/6] xfs: return bool from xfs_attr3_leaf_add Christoph Hellwig
2024-08-21 15:56   ` Darrick J. Wong
2024-08-20 17:04 ` [PATCH 3/6] xfs: distinguish extra split from real ENOSPC from xfs_attr3_leaf_split Christoph Hellwig
2024-08-21 15:57   ` Darrick J. Wong
2024-08-22  3:40     ` Christoph Hellwig
2024-08-20 17:04 ` [PATCH 4/6] xfs: fold xfs_bmap_alloc_userdata into xfs_bmapi_allocate Christoph Hellwig
2024-08-21 15:59   ` Darrick J. Wong
2024-08-20 17:04 ` [PATCH 5/6] xfs: call xfs_bmap_exact_minlen_extent_alloc from xfs_bmap_btalloc Christoph Hellwig
2024-08-21  8:24   ` Christoph Hellwig
2024-08-21 16:04   ` Darrick J. Wong
2024-08-20 17:04 ` Christoph Hellwig [this message]
2024-08-21 16:07   ` [PATCH 6/6] xfs: support lowmode allocations in xfs_bmap_exact_minlen_extent_alloc Darrick J. Wong
2024-08-22  3:41     ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2024-08-24  3:40 fix a DEBUG-only assert failure in xfs/538 v2 Christoph Hellwig
2024-08-24  3:40 ` [PATCH 6/6] xfs: support lowmode allocations in xfs_bmap_exact_minlen_extent_alloc Christoph Hellwig
2024-08-27  8:39   ` Chandan Babu R

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240820170517.528181-7-hch@lst.de \
    --to=hch@lst.de \
    --cc=chandan.babu@oracle.com \
    --cc=djwong@kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox