From: "Zhou, Yun" <yun.zhou@windriver.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: cem@kernel.org, linux-xfs@vger.kernel.org,
linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: [PATCH] xfs: fix nofs context corruption in xfs_btree_split_worker
Date: Fri, 24 Jul 2026 15:54:10 +0800 [thread overview]
Message-ID: <3f683dea-fdee-416a-8112-2db000c4cf4e@windriver.com> (raw)
In-Reply-To: <al3dypUNu1VNZErK@infradead.org>
Hi Christoph,
On 7/20/2026 4:35 PM, Christoph Hellwig wrote:
> On Mon, Jul 20, 2026 at 01:05:22PM +0800, Yun Zhou wrote:
>> current_set_flags_nested(&pflags, new_pflags);
>> - xfs_trans_set_context(args->cur->bc_tp);
>> + nofs_flags = memalloc_nofs_save();
>
> Note that the above is the only user of current_set_flags_nested.
>
>> 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);
>> current_restore_flags_nested(&pflags, new_pflags);
>
> and this is the only caller of current_restore_flags_nested. Both
> of which modify the task flags just like memalloc_nofs_save.
>
> I think we'd be much better of just killing all these silly helpers
> and do direct current->flags manipulations, which will both clarify
> this code and fix the bug it caused.
>
> Similarly xfs_trans_set_context / xfs_trans_set_context need to go
> away as they were a part of this problem. And to make this coherent,
> it should be combined with your other flags series.
>
Thanks a lot.
I'd like to understand the scope you have in mind. Should the removal of
xfs_trans_set/clear_context and current_set/restore_flags_nested be part
of my nofs series, or is that something you'd prefer to handle separately?
BR,
Yun
next prev parent reply other threads:[~2026-07-24 7:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 5:05 [PATCH] xfs: fix nofs context corruption in xfs_btree_split_worker Yun Zhou
2026-07-20 8:35 ` Christoph Hellwig
2026-07-24 7:54 ` Zhou, Yun [this message]
2026-07-24 8:06 ` Christoph Hellwig
2026-07-24 8:14 ` Zhou, Yun
2026-07-24 13:42 ` Christoph Hellwig
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=3f683dea-fdee-416a-8112-2db000c4cf4e@windriver.com \
--to=yun.zhou@windriver.com \
--cc=akpm@linux-foundation.org \
--cc=cem@kernel.org \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.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