All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: set minleft correctly for randomly sparse inode allocations
@ 2022-12-30  6:22 Guo Xuenan
  0 siblings, 0 replies; only message in thread
From: Guo Xuenan @ 2022-12-30  6:22 UTC (permalink / raw)
  To: djwong, dchinner, linux-xfs
  Cc: guoxuenan, guoxuenan, houtao1, jack.qiu, yi.zhang, zhengbin13

In DEBUG mode may do sparse inode allocations randomly, but forget to
set the remaining space correctly for the inode btree to split.
It's OK for most cases, only under DEBUG mode and AG space is running
out may bring something bad.

Fixes: 1cdadee11f8d ("xfs: randomly do sparse inode allocations in DEBUG mode")
Signed-off-by: Guo Xuenan <guoxuenan@huawei.com>
---
 fs/xfs/libxfs/xfs_ialloc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/xfs/libxfs/xfs_ialloc.c b/fs/xfs/libxfs/xfs_ialloc.c
index 94db50eb706a..29bc160312ec 100644
--- a/fs/xfs/libxfs/xfs_ialloc.c
+++ b/fs/xfs/libxfs/xfs_ialloc.c
@@ -763,6 +763,8 @@ xfs_ialloc_ag_alloc(
 		args.alignment = args.mp->m_sb.sb_spino_align;
 		args.prod = 1;
 
+		/* Allow space for the inode btree to split */
+		args.minleft = igeo->inobt_maxlevels;
 		args.minlen = igeo->ialloc_min_blks;
 		args.maxlen = args.minlen;
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-30  6:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-30  6:22 [PATCH] xfs: set minleft correctly for randomly sparse inode allocations Guo Xuenan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.