From: Matthew Wilcox <willy@infradead.org>
To: David Howells <dhowells@redhat.com>
Cc: Yun Zhou <yun.zhou@windriver.com>,
Christoph Hellwig <hch@infradead.org>,
Christian Brauner <brauner@kernel.org>,
pc@manguebit.org, netfs@lists.linux.dev,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Is writeback_iter() missing some error handling? -- was Re: [PATCH] netfs: fix ENOMEM handling in netfs_writepages() to drain all dirty folios
Date: Thu, 23 Jul 2026 13:44:09 +0100 [thread overview]
Message-ID: <amIMmbxG2PM5yMo6@casper.infradead.org> (raw)
In-Reply-To: <82546.1784729043@warthog.procyon.org.uk>
On Wed, Jul 22, 2026 at 03:04:03PM +0100, David Howells wrote:
> This seems like the wrong thing to do - or, at least, a bug in the
> writeback_iter() API. Getting something like ENOMEM would seem to indicate
> that all subsequent writeback_iter() calls in this loop are pointless as it
> looks like the sequence will just go { lock, undirty, dirty, unlock } for each
> folio.
I'd find it hard to call a bug, when it's intended behaviour:
* For integrity writeback we have to keep going until we have
* written all the folios we tagged for writeback above, even if
* we run past wbc->nr_to_write or encounter errors.
* We stash away the first error we encounter in wbc->saved_err
* so that it can be retrieved when we're done. This is because
* the file system may still have state to clear for each folio.
*
* For background writeback we exit as soon as we run past
* wbc->nr_to_write or encounter the first error.
Why are you getting ENOMEM for a sync() writeback anyway? Is this some
stupid error injection?
next prev parent reply other threads:[~2026-07-23 12:44 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 [this message]
2026-07-23 4:59 ` Christoph Hellwig
2026-07-23 7:25 ` Zhou, Yun
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=amIMmbxG2PM5yMo6@casper.infradead.org \
--to=willy@infradead.org \
--cc=brauner@kernel.org \
--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 \
--cc=yun.zhou@windriver.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
Powered by JetHome