From: "Zhou, Yun" <yun.zhou@windriver.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: dhowells@redhat.com, pc@manguebit.org, netfs@lists.linux.dev,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] netfs: fix ENOMEM handling in netfs_writepages() to drain all dirty folios
Date: Thu, 23 Jul 2026 15:25:05 +0800 [thread overview]
Message-ID: <9fea3180-227b-4d85-9a60-16caee66be8d@windriver.com> (raw)
In-Reply-To: <amGfmQHmZZuBkcwq@infradead.org>
On 7/23/26 12:59, Christoph Hellwig wrote:
> On Tue, Jul 07, 2026 at 01:25:55PM +0800, Yun Zhou wrote:
>> When netfs_create_write_req() fails with -ENOMEM in netfs_writepages(),
>> the couldnt_start error path redirties and unlocks the first folio,
>
> writeback must use mempools to back resoures, or __GFP_NOFAIL if it
> can't for some reason. -ENOMEM must not happend in writeback paths
> or your toast. So please fix the cause of this error and not the
> symptoms.
>
Thanks for the review. You're right - writeback should not fail with ENOMEM.
I'll follow your suggestion and use __GFP_NOFAIL for the allocation in
the writeback path. The ENOMEM here comes from rolling_buffer_init()
which uses plain GFP_NOFS for its folio_queue allocation.
Using mempools would be the more robust approach, but it requires adding
a new mempool, modifying the rolling_buffer_init() signature and all its
callers, plus the init/destroy lifecycle - a much larger change.
__GFP_NOFAIL is a minimal fix that achieves the same goal for the
writeback path.
Will send v2 shortly.
prev parent reply other threads:[~2026-07-23 7:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 5:25 Yun Zhou
2026-07-07 6:13 ` Zhou, Yun
2026-07-19 12:32 ` Zhou, Yun
2026-07-22 14:04 ` Is writeback_iter() missing some error handling? -- was " David Howells
2026-07-23 3:43 ` Zhou, Yun
2026-07-23 12:44 ` Matthew Wilcox
2026-07-23 4:59 ` Christoph Hellwig
2026-07-23 7:25 ` Zhou, Yun [this message]
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=9fea3180-227b-4d85-9a60-16caee66be8d@windriver.com \
--to=yun.zhou@windriver.com \
--cc=dhowells@redhat.com \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netfs@lists.linux.dev \
--cc=pc@manguebit.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
Powered by JetHome