Re: [PATCH] netfs: fix ENOMEM handling in netfs_writepages() to drain all dirty folios

From: Christoph Hellwig

Date: Thu Jul 23 2026 - 01:21:42 EST


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.