Re: linux-next: manual merge of the fs-next tree with the mm tree
From: Sasha Levin
Date: Mon Oct 19 2026 - 07:49:32 EST
On Mon, Sep 28, 2026 at 01:48:14PM +0100, Mark Brown wrote:
> There is a fixup in -next already which is hopefully OK, I don't recall
> it being especially bad so probably Linus would be OK with resolving it.
Hi Mark,
The fixup in -next takes the mm side of xfs_btree_split_worker()
verbatim, which puts xfs_trans_set_context()/xfs_trans_clear_context()
back and drops
23f91a51425e ("xfs: fix NOFS state corruption in btree split worker")
next-20261016 still has it this way.
The two changes are independent:
2e6a6ca06fec ("xfs: remove dead kswapd flag inheritance from btree split worker")
removes the pflags handling, and the xfs fix replaces the transaction
context calls with a local memalloc_nofs_save()/memalloc_nofs_restore().
The resolution should keep both. The delta against next-20261016 is
below.
Neither tree conflicts with v7.3 here on its own, so whichever of the mm
and xfs pull requests goes second will hit this. Andrew, Carlos, could
that pull request point Linus at this resolution rather than the one
earlier in this thread?
This is the resolution llminus generates:
diff --git a/fs/xfs/libxfs/xfs_btree.c b/fs/xfs/libxfs/xfs_btree.c
index 6738d9d1511bc..2434c54a35708 100644
--- a/fs/xfs/libxfs/xfs_btree.c
+++ b/fs/xfs/libxfs/xfs_btree.c
@@ -3007,12 +3007,18 @@ xfs_btree_split_worker(
{
struct xfs_btree_split_args *args = container_of(work,
struct xfs_btree_split_args, work);
- xfs_trans_set_context(args->cur->bc_tp);
+ unsigned int nofs_flags;
+
+ /*
+ * Don't use xfs_trans_set_context() here: it would overwrite the
+ * caller's saved NOFS state in tp->t_pflags. Use a local scope.
+ */
+ nofs_flags = memalloc_nofs_save();
args->result = __xfs_btree_split(args->cur, args->level, args->ptrp,
args->key, args->curp, args->stat);
- xfs_trans_clear_context(args->cur->bc_tp);
+ memalloc_nofs_restore(nofs_flags);
/*
* Do not access args after complete() has run here. We don't own args
--
Thanks,
Sasha