* [PATCH] netfs: Fix barriering when walking subrequest list
@ 2026-07-02 8:23 David Howells
2026-07-02 12:59 ` Paulo Alcantara
2026-07-03 9:52 ` Christian Brauner
0 siblings, 2 replies; 3+ messages in thread
From: David Howells @ 2026-07-02 8:23 UTC (permalink / raw)
To: Christian Brauner
Cc: dhowells, Paulo Alcantara, netfs, linux-fsdevel, linux-kernel
Fix the barriering used when walking the subrequest list in retry as
there's a possibility of seeing a subreq that's just been added by the
application thread.
Fixes: ee4cdf7ba857 ("netfs: Speed up buffered reading")
Fixes: 288ace2f57c9 ("netfs: New writeback implementation")
Link: https://sashiko.dev/#/patchset/20260608145432.681865-1-dhowells%40redhat.com
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Paulo Alcantara <pc@manguebit.org>
cc: netfs@lists.linux.dev
cc: linux-fsdevel@vger.kernel.org
---
fs/netfs/read_retry.c | 7 ++++++-
fs/netfs/write_retry.c | 7 ++++++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/fs/netfs/read_retry.c b/fs/netfs/read_retry.c
index f59a70f3a086..2b42758e01ec 100644
--- a/fs/netfs/read_retry.c
+++ b/fs/netfs/read_retry.c
@@ -98,7 +98,12 @@ static void netfs_retry_read_subrequests(struct netfs_io_request *rreq)
goto abandon;
}
- list_for_each_continue(next, &stream->subrequests) {
+ for (;;) {
+ /* Read pointer to subreq before reading subreq state. */
+ next = smp_load_acquire(&next->next);
+ if (next == &stream->subrequests)
+ break;
+
subreq = list_entry(next, struct netfs_io_subrequest, rreq_link);
if (subreq->start + subreq->transferred != start + len ||
test_bit(NETFS_SREQ_BOUNDARY, &subreq->flags) ||
diff --git a/fs/netfs/write_retry.c b/fs/netfs/write_retry.c
index 32735abfa03f..058bc7a166a5 100644
--- a/fs/netfs/write_retry.c
+++ b/fs/netfs/write_retry.c
@@ -72,7 +72,12 @@ static void netfs_retry_write_stream(struct netfs_io_request *wreq,
!test_bit(NETFS_SREQ_NEED_RETRY, &from->flags))
return;
- list_for_each_continue(next, &stream->subrequests) {
+ for (;;) {
+ /* Read pointer to subreq before reading subreq state. */
+ next = smp_load_acquire(&next->next);
+ if (next == &stream->subrequests)
+ break;
+
subreq = list_entry(next, struct netfs_io_subrequest, rreq_link);
if (subreq->start + subreq->transferred != start + len ||
test_bit(NETFS_SREQ_BOUNDARY, &subreq->flags) ||
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] netfs: Fix barriering when walking subrequest list
2026-07-02 8:23 [PATCH] netfs: Fix barriering when walking subrequest list David Howells
@ 2026-07-02 12:59 ` Paulo Alcantara
2026-07-03 9:52 ` Christian Brauner
1 sibling, 0 replies; 3+ messages in thread
From: Paulo Alcantara @ 2026-07-02 12:59 UTC (permalink / raw)
To: David Howells, Christian Brauner
Cc: dhowells, netfs, linux-fsdevel, linux-kernel
David Howells <dhowells@redhat.com> writes:
> Fix the barriering used when walking the subrequest list in retry as
> there's a possibility of seeing a subreq that's just been added by the
> application thread.
>
> Fixes: ee4cdf7ba857 ("netfs: Speed up buffered reading")
> Fixes: 288ace2f57c9 ("netfs: New writeback implementation")
> Link: https://sashiko.dev/#/patchset/20260608145432.681865-1-dhowells%40redhat.com
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: Paulo Alcantara <pc@manguebit.org>
> cc: netfs@lists.linux.dev
> cc: linux-fsdevel@vger.kernel.org
> ---
> fs/netfs/read_retry.c | 7 ++++++-
> fs/netfs/write_retry.c | 7 ++++++-
> 2 files changed, 12 insertions(+), 2 deletions(-)
Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.org>
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] netfs: Fix barriering when walking subrequest list
2026-07-02 8:23 [PATCH] netfs: Fix barriering when walking subrequest list David Howells
2026-07-02 12:59 ` Paulo Alcantara
@ 2026-07-03 9:52 ` Christian Brauner
1 sibling, 0 replies; 3+ messages in thread
From: Christian Brauner @ 2026-07-03 9:52 UTC (permalink / raw)
To: David Howells; +Cc: Paulo Alcantara, netfs, linux-fsdevel, linux-kernel
On Thu, 02 Jul 2026 09:23:02 +0100, David Howells wrote:
> netfs: Fix barriering when walking subrequest list
Applied to the vfs.fixes branch of the vfs/vfs.git tree.
Patches in the vfs.fixes branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
Note that commit hashes shown below are subject to change due to rebase,
trailer updates or similar. If in doubt, please check the listed branch.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.fixes
[1/1] netfs: Fix barriering when walking subrequest list
https://git.kernel.org/vfs/vfs/c/5c6ce05e4065
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-07-03 9:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-02 8:23 [PATCH] netfs: Fix barriering when walking subrequest list David Howells
2026-07-02 12:59 ` Paulo Alcantara
2026-07-03 9:52 ` Christian Brauner
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.