From: "Zhou, Yun" <yun.zhou@windriver.com>
To: Carlos Maiolino <cem@kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>,
Kefeng Wang <wangkefeng.wang@huawei.com>,
brauner@kernel.org, djwong@kernel.org, akpm@linux-foundation.org,
vbabka@kernel.org, surenb@google.com, mhocko@suse.com,
brendan.jackman@linux.dev, hannes@cmpxchg.org, ziy@nvidia.com,
david@kernel.org, qi.zheng@linux.dev, shakeel.butt@linux.dev,
ljs@kernel.org, linux-xfs@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] xfs: fix NOFS state corruption in btree split worker
Date: Tue, 15 Sep 2026 18:34:49 +0800 [thread overview]
Message-ID: <e6af011f-005c-465e-b441-958543faf5a9@windriver.com> (raw)
In-Reply-To: <aqkKPU8HNkt_uV-m@nidhogg.toxiclabs.cc>
On 9/15/26 17:19, Carlos Maiolino wrote:
>> On 9/10/26 13:47, Christoph Hellwig wrote:
>>> Adding Yun Zhou, whoch touched this area recently.
>>>
>>> On Thu, Sep 03, 2026 at 09:37:56PM +0800, Kefeng Wang wrote:
>>>> xfs_btree_split_worker() calls xfs_trans_set_context() and
>>>> xfs_trans_clear_context() on the caller's transaction, overwriting
>>>> tp->t_pflags with the worker's NOFS state. When the caller already has
>>>> PF_MEMALLOC_NOFS set (e.g. xfs_end_ioend_write, xfs_dio_write_end_io),
>>>> the corrupted tp->t_pflags causes xfs_trans_free() to erroneously clear
>>>> the caller's NOFS protection.
>>>>
>>>> Use memalloc_nofs_save/restore with a local variable instead so
>>>> tp->t_pflags is never touched.
>>>
>>> Looks good:
>>>
>>> Reviewed-by: Christoph Hellwig <hch@lst.de>
>>>
>>> Btw, if you have some spare time, it would be nice to kill
>>> xfs_trans_set_context/xfs_trans_clear_context as follow up given that
>>> they keep causing confusion.
>>
>> Yes, you finished reviewing this patch [1] in July. However, I'm not sure
>> about its current status. Perhaps I should ping Carlos to check?
>>
>> [1]
>> https://lore.kernel.org/all/20260720050522.3101824-1-yun.zhou@windriver.com/
>
> Ok, now I see why Kefeng Wang re-sent these patches...
>
> The first submission in July slipped through the cracks (I was on vacation
> that specific week FWIW). Feel free to give me a heads up if something
> don't get pulled in 1 or 2 weeks.
>
> This one though is buried in a multi-subsystem series because you sent
> the patch In-Reply-To one of the emails in that thread.
> Please don't send patches as In-Reply-To something else, specially to a
> multi-subsystem series because it's really easy to skip such patches.
>
> And then I got a "Re-Send" series with zero information why it has
> been re-sent, and one of the patches in that series was already picked
> up by Andrew. So I can't simply merge that here and mess up with what
> Andrew already planned.
>
> If this patch can be merged before:
>
> commit 14ec230f93fa928090507cfdc67ca67e928d0c9f (linux-mm)
> Author: Kefeng Wang <wangkefeng.wang@huawei.com>
> Date: Wed Sep 2 21:16:50 2026 +0800
>
> xfs: remove dead kswapd flag inheritance from btree split worker
>
> then please re-send it, otherwise wait for the above patch to land in
> Linus's tree, rebase and re-send.
>
To be honest, I was on vacation in August, and I've been busy catching
up on backlogged work since I returned. I admit I lost track of some
patches' status. That is entirely my fault, and I sincerely apologize.
More importantly, my patch modifies the same code in
xfs_btree_split_worker() as Kefeng's series, which is already under
review and heading in the same direction. Therefore, there's no point in
my resending mine. Please just ignore my patch and let Kefeng's series
cover it.
Thanks,
Yun
next prev parent reply other threads:[~2026-09-15 10:35 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 13:16 [PATCH 0/4] mm: replace PF_KCOMPACTD/PF_KSWAPD with kthread_func() Kefeng Wang
2026-09-02 13:16 ` [PATCH 1/4] xfs: remove dead kswapd flag inheritance from btree split worker Kefeng Wang
2026-09-02 14:32 ` Christoph Hellwig
2026-09-02 15:33 ` Shakeel Butt
2026-09-02 13:16 ` [PATCH 2/4] iomap: simplify writepages reclaim guard Kefeng Wang
2026-09-02 14:32 ` Christoph Hellwig
2026-09-03 13:46 ` Kefeng Wang
2026-09-02 15:34 ` Shakeel Butt
2026-09-02 13:16 ` [PATCH 3/4] mm: replace PF_KSWAPD flag with kthread_func() check Kefeng Wang
2026-09-02 15:36 ` Shakeel Butt
2026-09-02 16:35 ` Vlastimil Babka (SUSE)
2026-09-02 16:39 ` Zi Yan
2026-09-10 11:56 ` David Hildenbrand (Arm)
2026-09-02 13:16 ` [PATCH 4/4] mm: replace PF_KCOMPACTD " Kefeng Wang
2026-09-02 15:37 ` Shakeel Butt
2026-09-02 16:36 ` Vlastimil Babka (SUSE)
2026-09-02 16:40 ` Zi Yan
2026-09-10 11:57 ` David Hildenbrand (Arm)
2026-09-02 15:31 ` [PATCH 0/4] mm: replace PF_KCOMPACTD/PF_KSWAPD with kthread_func() Shakeel Butt
2026-09-02 20:44 ` Andrew Morton
2026-09-03 13:37 ` [PATCH] xfs: fix NOFS state corruption in btree split worker Kefeng Wang
2026-09-03 13:52 ` Brian Foster
2026-09-04 0:41 ` Kefeng Wang
2026-09-04 11:57 ` Brian Foster
2026-09-10 5:47 ` Christoph Hellwig
2026-09-10 6:07 ` Darrick J. Wong
2026-09-15 7:09 ` Zhou, Yun
2026-09-15 9:19 ` Carlos Maiolino
2026-09-15 10:34 ` Zhou, Yun [this message]
2026-09-15 10:50 ` Carlos Maiolino
[not found] ` <20260910140742.833170-1-wangkefeng.wang@huawei.com>
[not found] ` <aqLqeTsbKBMEsl-G@bfoster>
2026-09-11 0:57 ` [PATCH] xfs: kill xfs_trans_set/clear_context() helpers Kefeng Wang
2026-09-11 7:12 ` Christoph Hellwig
2026-09-11 10:51 ` Kefeng Wang
2026-09-03 13:40 ` [PATCH 0/4] mm: replace PF_KCOMPACTD/PF_KSWAPD with kthread_func() Kefeng Wang
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=e6af011f-005c-465e-b441-958543faf5a9@windriver.com \
--to=yun.zhou@windriver.com \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=brendan.jackman@linux.dev \
--cc=cem@kernel.org \
--cc=david@kernel.org \
--cc=djwong@kernel.org \
--cc=hannes@cmpxchg.org \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-xfs@vger.kernel.org \
--cc=ljs@kernel.org \
--cc=mhocko@suse.com \
--cc=qi.zheng@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=surenb@google.com \
--cc=vbabka@kernel.org \
--cc=wangkefeng.wang@huawei.com \
--cc=ziy@nvidia.com \
/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