From: David Howells <dhowells@redhat.com>
To: Christian Brauner <christian@brauner.io>
Cc: David Howells <dhowells@redhat.com>,
Paulo Alcantara <pc@manguebit.org>,
Christoph Hellwig <hch@infradead.org>,
netfs@lists.linux.dev, linux-afs@lists.infradead.org,
linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org,
linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
Matthew Wilcox <willy@infradead.org>
Subject: [PATCH v3 14/15] netfs: Fix folio state after ENOMEM whilst under writeback iteration
Date: Thu, 25 Jun 2026 15:06:32 +0100 [thread overview]
Message-ID: <20260625140640.3116900-15-dhowells@redhat.com> (raw)
In-Reply-To: <20260625140640.3116900-1-dhowells@redhat.com>
Fix the state of the current folio when ENOMEM occurs during writeback
iteration. The folio needs to be redirtied and unlocked before the
terminal writeback_iter() is invoked.
Fixes: 06fa229ceb36 ("netfs: Abstract out a rolling folio buffer implementation")
Link: https://sashiko.dev/#/patchset/20260619140646.2633762-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Paulo Alcantara <pc@manguebit.org>
cc: Matthew Wilcox <willy@infradead.org>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
---
fs/netfs/write_issue.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/netfs/write_issue.c b/fs/netfs/write_issue.c
index 3682896c3fdf..f2761c99795a 100644
--- a/fs/netfs/write_issue.c
+++ b/fs/netfs/write_issue.c
@@ -582,6 +582,10 @@ int netfs_writepages(struct address_space *mapping,
}
error = netfs_write_folio(wreq, wbc, folio);
+ if (error == -ENOMEM) {
+ folio_redirty_for_writepage(wbc, folio);
+ folio_unlock(folio);
+ }
} while ((folio = writeback_iter(mapping, wbc, folio, &error)));
netfs_end_issue_write(wreq);
next prev parent reply other threads:[~2026-06-25 14:08 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-25 14:06 [PATCH v3 00/15] netfs: Miscellaneous fixes David Howells
2026-06-25 14:06 ` [PATCH v3 01/15] netfs: Fix decision whether to disallow write-streaming due to fscache use David Howells
2026-06-25 14:06 ` [PATCH v3 02/15] netfs: Fix netfs_create_write_req() to handle async cache object creation David Howells
2026-06-25 14:06 ` [PATCH v3 03/15] cachefiles: Fix double fput David Howells
2026-06-25 14:06 ` [PATCH v3 04/15] cachefiles: Fix file burial to take lock when unsetting S_KERNEL_FILE David Howells
2026-06-26 3:17 ` NeilBrown
2026-06-25 14:06 ` [PATCH v3 05/15] iov_iter: Fix potential underflow in iov_iter_extract_xarray_pages() David Howells
2026-06-26 5:49 ` Christoph Hellwig
2026-06-25 14:06 ` [PATCH v3 06/15] iov_iter: Fix missing alloc fail check in iov_iter_extract_bvec_pages() David Howells
2026-06-26 5:50 ` Christoph Hellwig
2026-06-25 14:06 ` [PATCH v3 07/15] iov_iter: Fix a memory leak in iov_iter_extract_user_pages() David Howells
2026-06-26 5:50 ` Christoph Hellwig
2026-06-25 14:06 ` [PATCH v3 08/15] iov_iter: Remove unused variable in kunit_iov_iter.c David Howells
2026-06-26 5:51 ` Christoph Hellwig
2026-06-25 14:06 ` [PATCH v3 09/15] scatterlist: Fix offset in folio calc in extract_xarray_to_sg() David Howells
2026-06-26 5:51 ` Christoph Hellwig
2026-06-25 14:06 ` [PATCH v3 10/15] netfs: Fix kdoc warning David Howells
2026-06-25 14:06 ` [PATCH v3 11/15] netfs: Replace wb_lock with a bit lock for asynchronicity David Howells
2026-06-25 14:06 ` [PATCH v3 12/15] netfs: Fix writethrough to use collection offload David Howells
2026-06-25 14:06 ` [PATCH v3 13/15] netfs: Fix writeback error handling David Howells
2026-06-25 14:06 ` David Howells [this message]
2026-06-25 14:06 ` [PATCH v3 15/15] netfs: Fix DIO write retry for filesystems without a ->prepare_write() David Howells
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=20260625140640.3116900-15-dhowells@redhat.com \
--to=dhowells@redhat.com \
--cc=ceph-devel@vger.kernel.org \
--cc=christian@brauner.io \
--cc=hch@infradead.org \
--cc=linux-afs@lists.infradead.org \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netfs@lists.linux.dev \
--cc=pc@manguebit.org \
--cc=willy@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.