diff mbox series

[4/5] xfs: apply noalloc mode to inode allocations too

Message ID 173568777070.2709441.10513728780460673933.stgit@frogsfrogsfrogs (mailing list archive)
State New
Headers show
Series [1/5] xfs: track deferred ops statistics | expand

Commit Message

Darrick J. Wong Dec. 31, 2024, 11:44 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

Don't allow inode allocations from this group if it's marked noalloc.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
 libxfs/xfs_ialloc.c |    3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/libxfs/xfs_ialloc.c b/libxfs/xfs_ialloc.c
index b401299ad933f7..a086fb30b227a0 100644
--- a/libxfs/xfs_ialloc.c
+++ b/libxfs/xfs_ialloc.c
@@ -1102,6 +1102,7 @@  xfs_dialloc_ag_inobt(
 
 	ASSERT(xfs_perag_initialised_agi(pag));
 	ASSERT(xfs_perag_allows_inodes(pag));
+	ASSERT(!xfs_perag_prohibits_alloc(pag));
 	ASSERT(pag->pagi_freecount > 0);
 
  restart_pagno:
@@ -1730,6 +1731,8 @@  xfs_dialloc_good_ag(
 		return false;
 	if (!xfs_perag_allows_inodes(pag))
 		return false;
+	if (xfs_perag_prohibits_alloc(pag))
+		return false;
 
 	if (!xfs_perag_initialised_agi(pag)) {
 		error = xfs_ialloc_read_agi(pag, tp, 0, NULL);